Browser and HttpSession Object

Discussion in 'Java' started by Tim, Sep 3, 2003.

  1. Tim

    Tim Guest

    How can I force my webapp to create a new session for every new
    browser-window?

    tia.
    Tim, Sep 3, 2003
    #1
    1. Advertising

  2. On Wed, 03 Sep 2003 09:21:22 +0200, Tim wrote:

    > How can I force my webapp to create a new session for every new
    > browser-window?


    I don't think you have control over this when using cookies. Most
    browsers don't see different windows as different sessions. However, with
    url rewriting (session id's in the URI) I think you can make it work.

    Roger Lindsjö
    =?iso-8859-1?q?Roger_Lindsj=F6?=, Sep 3, 2003
    #2
    1. Advertising

  3. Roger Lindsjö wrote:
    > On Wed, 03 Sep 2003 09:21:22 +0200, Tim wrote:
    >
    >
    >>How can I force my webapp to create a new session for every new
    >>browser-window?

    >
    >
    > I don't think you have control over this when using cookies. Most
    > browsers don't see different windows as different sessions. However, with
    > url rewriting (session id's in the URI) I think you can make it work.


    On the other hand, it may be difficult to prevent your servlet container
    from managing sessions via cookies when it can, and it is unwise to
    postulate implementing different behavior for different session tracking
    mechanisms. The approach most people take is simply to take into
    account that there may be multiple browser windows open on the same
    session at the same time. It is usually better to make your application
    more flexible and robust than to attempt to force its environment and
    clients to cater to its limitations and foibles.


    John Bollinger
    John C. Bollinger, Sep 3, 2003
    #3
  4. "John C. Bollinger" wrote:
    >
    > Roger Lindsjö wrote:
    > > On Wed, 03 Sep 2003 09:21:22 +0200, Tim wrote:
    > >
    > >
    > >>How can I force my webapp to create a new session for every new
    > >>browser-window?

    > >
    > >
    > > I don't think you have control over this when using cookies. Most
    > > browsers don't see different windows as different sessions. However, with
    > > url rewriting (session id's in the URI) I think you can make it work.

    >
    > On the other hand, it may be difficult to prevent your servlet container
    > from managing sessions via cookies when it can, and it is unwise to
    > postulate implementing different behavior for different session tracking
    > mechanisms. The approach most people take is simply to take into
    > account that there may be multiple browser windows open on the same
    > session at the same time. It is usually better to make your application
    > more flexible and robust than to attempt to force its environment and
    > clients to cater to its limitations and foibles.
    >
    > John Bollinger
    >


    But, you could view the problem as having sessions and "sub-sessions"
    and write your own mechanism for handling the sub-session by manually
    rewriting the urls with your own sub-session id. I don't know if you
    could make use of the existing HttpSession class to do that, though, but
    you may not need the complete functionality of that class anyway.


    --
    Steve
    --
    http://www.steveclaflin.com
    Steve Claflin, Sep 3, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?cHJhZGVlcF9UUA==?=

    HttpSession Class

    =?Utf-8?B?cHJhZGVlcF9UUA==?=, Oct 16, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    7,113
    Joerg Jooss
    Oct 16, 2005
  2. Jim
    Replies:
    3
    Views:
    16,443
  3. xarora
    Replies:
    4
    Views:
    3,889
    xarora
    Aug 7, 2005
  4. che
    Replies:
    2
    Views:
    478
  5. alex_f
    Replies:
    0
    Views:
    649
    alex_f
    Sep 27, 2006
Loading...

Share This Page