Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About Session.

 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I m bit doughtful about following lines from Hanumant Deshmukhs book
at page 168.
[B]A user can open multiple browser windows and send requests through multiple windows. In such
instances, all the requests belong to the same session[B].
As per my knowledge so far,for every browser,server will create new session.
I tried to do this with tomcat 4.1.18 and I got new session for every new instance of browser.
Kindly let me know if there is some thing which I m not aware of.
Cheers
-Praful
 
Vijay Sargunam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Praful,
You are right, in IE a different session is created for each browser window. However, if you try it in other browsers it may not be true. Also, in IE, when you working with 2 sessions(ie. 2 browser) in the same web applications, you find that session mixing happens i.e. the values from one browser is shown in the other. This happens because of the multi thread accessing the _jspService method. To prevent that, and to be sure that it never happens in and is compatible with other browsers, we should get a lock on the session object by sycronizing it.
Hope the information is helpful.
Regards,
Vijay
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijay ,
Thanx A bunch for your reply.Things are much clear now
 
Kalpesh Soni
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, it also matters how u open a new IE instance
by clicking the icon
or use CTRL + N
2nd case will pobably use same session !
 
Praful Thakare
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your right Kalpesh,
opening browser with cltr+n will continue same session,even for IE.
Where as Netscape takes you to same session,no matter how u open the browser
cheers
Praful
 
Vijay Sargunam
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Ctrl + N or a link in the page to open a new window will definitely continue with the same session(atleast in IE). However, even if you open new windows without Ctrl + N or without a link, sometime session mixing happens, coz of multiple thread access of the _jspService method by the container. To prevent this session mixing (and not the Ctrl + N or link), you need to sychronize the session object. Hope this helps
Vijay
 
Will St Hubert
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you open a browser (IE) wich already have a parent window with a valid session with your web app. The child window uses that same session.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic