Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Session ID  RSS feed

 
Raj Kumar
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, i have a doubt with regard to sessions below is the case which i had noticed.

I have created a webapplication (it is in beginning stage) with 2 JSP's index1.jsp & index2.jsp and a servlet which acts as a dispatcher to all the JSP's (i.e all the request will bypass only through this servlet)

I had given the following statement in the servlet service method

System.out.println("val "+objReq.getRequestedSessionId());

Now when i open the same page in my webapplication in multiple windows & Tabs using Mozilla it gives the same session id but the same is not the case when i do with IE for each and every window and i open it gives a different session id.

What is the reason behind it???

In some cases IE retunrs session id has null.

When i open my application in IE tab of mozilla all the IE tab returns the same session id which is different from mozilla tab.

I'am confused over it. Pls. explain.

I had not given any statments like getSession / getSession(true) in my application.


thanks in advance.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check if the cookies are disabled in IE.
 
Raj Kumar
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Rahul,

I tried to both allow & block and in both the cases IE is either creating new session id each and every time (or) it returns null (very rare and i can't recreate this case)

Two things noted here

1) In IE if i open a new window by using File->Window it gives the same Session id (this case is normal).

2) In Mozilla when i open my application in IE tab even in multiple tabs it gives the same session id for all the IE tabs i started for my application.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MSIE behaves differently, in regard to session cookies, depending on how the window was spawned.

If, you open a new window by clicking on Start -> programs -> MSIE, you will get completely new instance of MSIE. It will have it's own space for session cookies and, as you have noted, will start a new session when it accesses your site.

If. on the other hand, you open a new window by typing CTRL+N or by using File-> New... from an existing instance's menus, the new window will share the session cookies with the existing instance. Both will take part in the same session.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!