Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sessions

 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?


Thanks for any help.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use different browsers. Some browsers will use the same session for different windows, some won't.
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Hebert Coelho
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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! [=
 
Soniya Ahuja
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic