I have a simple banking web application, which I'm trying to test locally.
I run the application twice, creating 2 browsers windows, and each one I log into the application under different usernames.
The problem is the session ID is the same for each user, which explains why my session beans are acting very strange.
So I have 2 questions:
1. I guess if this were a live web app with 2 users on different computers accessing the site, the session IDs would be distinct,
so how does the web app know this isn't the case, is it cause the IP address is the same, does this determine distinct sessions?
2. How can I realiably test web apps locally without getting this 'same session' problem?
Most of the browsers store cookies of the particular web application(if the allowed), and if you open more than one window, and request the same web application, then the browsers request the server with the sessionId cookie. So ultimately, many windows, but same sessionId. So use different browsers as David indicated!
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
I know that the IE has an option named -nomerge (or something like that) that you will not share your session on the tabs. But i can't tell you if you session will have the same ID. You can try it! [=
Even in Mozilla Firefox, if you have logged in to Gmail in one browser, then accessing GMail from another browser will directly pickup the same login credentials.
IE8 Seems to be a little more confusing. In IE8, sessions are not just stored in cookies. So if you try to disable cookies, even then sessions will work and they work across different browsers as well and then there is the -nomerge that you can try.
SCJP 1.5 | SCWCD 5 | SCJP 6.0
[url]http://a2zjava.webs.com[/url] - Online training for Java/JSPs and Servlets/SCJP/SCWCD
http://soniyaahuja.webs.com