Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session is not working

 
Prasad Babu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all
Here is my code


The above code is working fine. but my problem is when user has opened one JSP by logging, he is able to open the same page in the different window which is required session. my intension is he should not open same page in different window. i.e. with same user id two pages should not be opened simultaneously. Anybody have the solution?

Thanks in advance.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand you correctly, yo don't want two or more windows opened by the same user to share the same session. It depends on the browser and how the new window was opened. With IE, if it's opened via file->New (cntrl-N), the new window will share the same session.
 
Sunil Pradhan
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Babu,

I am not clear whether you can restrict the user from sharing the same session with different instance of the browser,but for your login concern you can create (or use a existing one) a session attibute that indicates user is currently loged in.You can crosscheck this attribute before allowing him to login again through different browser instance.



Cheers ,
--------------
Sunil..
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Prasad Babu Dandu:

... but my problem is when user has opened one JSP by logging, he is able to open the same page in the different window which is required session. my intension is he should not open same page in different window. i.e. with same user id two pages should not be opened simultaneously.


There isn't much you can do about this.
Depending on how the user opens the new browser instance, the browser may or may not use the same session cookie for both windows.

For example: With MSIE, if you use CTRL+N to open a new instance both windows will have the same page and will both share the same session ID.
This happens without a call to the server.

If the user opens a new instance of MSIE by clicking on Start -> Programs-> MSIE then the new one will have it's own cookie space and can maintain a separate session within your app.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic