0

I have developed 1 web application but when multiple users are login on the same browser than jsp page of first user is changed by jsp page of second user.

PrimosK
  • 13,848
  • 10
  • 60
  • 78
ankit
  • 363
  • 2
  • 7
  • 16

3 Answers3

0

There is no way you can have multiple sessions simultaneously using a unique browser. Each time you create a new session, the session cookie which is used to track the current session is replaced by a new one.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • that means my application is working fine and session handling is also correct. so, problem is with bowser(i am using mozila firefox) – ankit Feb 17 '12 at 11:47
  • The problem is not with the browser. All the browsers behave the same way. The problem is with your expectations: you can't have multiple sessions simultaneously on a single browser. – JB Nizet Feb 17 '12 at 12:37
0

That's because your browser doesn't use a new session for each open tab. If you are using firefox you can install a special plugin to handle that behaviour for you. http://blog.techno-barje.fr/post/2009/12/05/Session-per-tab-in-Firefox/

Kris
  • 5,714
  • 2
  • 27
  • 47
0

Explanation on Spring Security FAQ page should answer the behaviour you encountered:

Browsers generally maintain a single session per browser instance. You cannot have two separate sessions at once. So if you log in again in another window or tab you are just reauthenticating in the same session. The server doesn't know anything about tabs, windows or browser instances. All it sees are HTTP requests and it ties those to a particular session according to the value of the the JSESSIONID cookie that they contain. When a user authenticates during a session, Spring Security's concurrent session control checks the number of other authenticated sessions that they have. If they are already authenticated with the same session, then re-authenticating will have no effect.

PrimosK
  • 13,848
  • 10
  • 60
  • 78