IE6 and ServletSession...

Discussions

Web tier: servlets, JSP, Web frameworks: IE6 and ServletSession...

  1. IE6 and ServletSession... (11 messages)

    Hi,
    has anybody faced problem with IE6 and Servlet session ? When i open another instance of browser(IE6)it considers me in the same servlet session of prev browser. The same is not with IE5 or 5.5 or netscape.

    Thanks
    Bhupesh

    Threaded Messages (11)

  2. IE6 and ServletSession...[ Go to top ]

    Are you absolutely sure you have the two instances and not just two windows? When you go into task manager how many IEXPLORE.EXE's do you see?
  3. IE6 and ServletSession...[ Go to top ]

    I am pretty sure about. I take two instances of IE. Do not open new window from prev browser with ctrl + N or something like. I have also tried printing session id using session.getID(), it gives same id for IE6. But when i do the same with IE5.5 or 5.0, it does not. I am wondering whats gone wrong or is this a property of IE6 that it sends same identification for browser, no matter how many new instances sending request goin to serever on same machine ?

    Thanks
    Bhupesh
  4. IE6 and ServletSession...[ Go to top ]

    You must have a strange setup on your machine. I just tested this in IE6 on my machine, and two separate instances of IE had two separate sessions.
  5. IE6 and ServletSession...[ Go to top ]

    This is really very strange with me too ... Let me tell, how i am getting session...
    session = request.getSession(true);
    Also, print saying session.getID(), which gives me same session id for both the instances of IE6. Mine is intranet application and its happening with all the machine having IE6. I have checked all options but no luck... Do u think problem is with the IE6 installation my organization has? Thats the last think i could do ... i think ...

    Bhupesh
  6. IE6 and ServletSession...[ Go to top ]

    It could be the IE6 setup your organization uses. That is the only thing I can think of. If you need to ensure multiple sessions, though, relying on browser behavior is not the right way to do it. Split your application logic into multiple web applications, each with their own session, and manage your multiple-sessions with server-side configuratio.
  7. IE6 and ServletSession...[ Go to top ]

    Definitely, I will make sure about the setup of IE6 in organization.
    Well... about u said "relying on browser behavior is not the right way to do it"
    I really did not understand... let me tell u the scenario where new session must be started with new browser.
    Say, user is logged in through one broweser... In my application I have stateful session bean which holds conversational state and has handles stored in HttpSession. Now... by taking another instance of browser from the same machine user logs in ... And, i definitely want user to get different session so that his handles for stateful ejbs r different this time. If second browser gets same session(this is what happening with me presently) it gets same handles and start changing the transactional state of previous browser's session which, leads to some absurd results.
    I will really appreciate if u elaborate your statement about ensuring multiple sessions.
  8. IE6 and ServletSession...[ Go to top ]

    The reason why I state that it is important not to rely on browser behavior is that you can't control it. Suppose, for example, that you depend on the user to always open a new browser process each time they open a new browser window (which they can do by starting Internet Explorer from the Start menu). What if they choose to open a new browser window from an existing window? (Say, using Ctrl-N)

    Since there is no way you can prevent users from typing Ctrl-N from an existing browser window, you should not rely on this browser "feature" as a mechanism for session management. You should design your application based on the assumption that the user could have multiple browser windows open, all for the same session.

    There are a lot of techniques for managing this sort of thing; I can't recommend anything specific without knowing more about what you are trying to do. The most straightforward thing is to not rely too much on stateful data (HttpSession and Stateful Session Beans), which is a good design technique in any case.
  9. IE6 and ServletSession...[ Go to top ]

    I understand what you are pointing to. But, if my requirement force me to use Servlet session for user, which benifit me in lot of ways, why shouldnt I use it? The problem I am facing is boiling down to very basic, where we decide what is user for an web application, a new browser instance or new id/pwd? I can manage things if i consider new id/pwd is new user. but when i assume new browser as new user, i land up with this problem.
    And ctrl + N was anticipated before application was designed.
  10. IE6 and ServletSession...[ Go to top ]

    Your problem is that you are making the wrong assumption. You are equating "New Browser equals New User" with "New Window equals New User". "New Browser" and "New Window" are not the same.

    Write your code with the correct assumption, namely that a single user can have multiple browser windows open. The server pretty much has no way to control how many browser windows a user will open.

    As for the session, yes, you can use it. But if you rely on it too much, you can get into trouble.
  11. IE6 and ServletSession...[ Go to top ]

    Me too getting the same problem of two requests and two treads in IE6.
    But the same is working perfectly well with IE5 and Netscape.
    I would like to know if any solution is available.
  12. IE6 and ServletSession...[ Go to top ]

    Hi Paul, we're currently considering a work-around for a similar problem/oversight of the transactional state of a web-app in my place of work. We have problems of "overwriting" values stored in the session when a single user is using multiple browser windows (that share the same session-id) at a single time. We've started discussing the options open to us and it looks like we'll have to make a pretty fundamental change to the way we store and access user session data. You mention that "There are a lot of techniques for managing this sort of thing", I'd be interested if you could share (at a high level) or provide some pointers to a couple of those strategies with us?