Results 1 to 8 of 8

Thread: [RESOLVED] Sessions and browsers

  1. #1

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Resolved [RESOLVED] Sessions and browsers

    I just wondered what exactly creates a new session on a web server.

    For example if i visit the same website in 2 different tabs of a tabbed browser would each create a new session on the server or would they both share the same 1?

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Sessions and browsers

    The person writing the page can set the timeout for a session, so how long you waited to open the second tab would determine whether you got a new sessionID or not.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  3. #3

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: Sessions and browsers

    ok I realise about session's timing out so if i simultaneously visit the same site then the different windows would share the session?

  4. #4

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: Sessions and browsers

    Actually ignore this I'll just write a quick web page and find out that way. I was just being lazy really wasn't I?

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: [RESOLVED] Sessions and browsers

    No, not really. But session isn't clearly defined. What software? PHP sessions? Java Servlet sessions? ASP.Net sessions? HTTP-Auth? Custom-built solutions?

    What it comes down to is this: HTTP-Auth is in the hands of the browser, but because it's not session management but only authentication, no browser I know of handles tabs separately.
    All other session management typically has two modes of operation: if cookies are available, they're used. Cookies are shared, so all tabs have the same session. If they're not available, though, URL rewriting is the typical solution. This means that every URL either must be passed to a special function or a special filter runs over the entire page. In this case, sessions are separate.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6

    Thread Starter
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: [RESOLVED] Sessions and browsers

    The sessions in question were asp.net and I'd never really thought about it before but was demo-ing a product in 2 firefox tabs and actions (that changed session variables) in 1 tab were affecting the application in the other tab too.

    Thanks, you were very informative.

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: [RESOLVED] Sessions and browsers

    Quote Originally Posted by CornedBee
    This means that every URL either must be passed to a special function or a special filter runs over the entire page. In this case, sessions are separate.
    Even if the URLs are the same?
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: [RESOLVED] Sessions and browsers

    If the URLs contain the same session key, it's the same session. If that happens by any means except opening a link from one session in another tab, it's a security hole.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width