Forums Register Login

Session Attribute

+Pie Number of slices to send: Send
Hello
In my application I set username as a session attribute - 'username'
But when I run the application in two different browser windows,
both windows show same values for the 'username' attribute
+Pie Number of slices to send: Send
That's true, because it's the same session

Regards,
+Pie Number of slices to send: Send
Depending upon which browser you are using and how the browser instances are created, the browser instances may share cookies. Since sessions are maintained by an id value stored as a cookie, this means that any instances that share cokkies will share the session.
[ November 04, 2007: Message edited by: Bear Bibeault ]
+Pie Number of slices to send: Send
 

Originally posted by Vassili Vladimir:
That's true, because it's the same session

Regards,



Thank you, Vassili
+Pie Number of slices to send: Send
 

Originally posted by Bear Bibeault:
Depending upon which browser you are using and how the browser instances are created, the browser instances may share cookies. Since sessions are maintained by an id value stored as a cookie, this means that any instances that share cokkies will share the session.

[ November 04, 2007: Message edited by: Bear Bibeault ]



Thank you, Bear
+Pie Number of slices to send: Send
 

Originally posted by Pranav Pal:


Thank you, Bear



How do I assure that browser instances do not share cookies?
+Pie Number of slices to send: Send
I believe that this primarily a problem with IE. If I recall, when you create a new instance from an existing window (as iwth ctrl-N), the instances will share cookies. If you create a new instance from the Start Menu, no sharing.

Check this before assuming that I'm remembering correctly.
+Pie Number of slices to send: Send
 

Originally posted by Bear Bibeault:
I believe that this primarily a problem with IE. If I recall, when you create a new instance from an existing window (as iwth ctrl-N), the instances will share cookies. If you create a new instance from the Start Menu, no sharing.

Check this before assuming that I'm remembering correctly.



Thanks..
If I open a new tab in existing window then only they are sharing cookies..
If I open two different windows then they do not share cookies..

I have another problem..
In a servlet I insert a row in the database
Then I dispatch the request to a jsp
If I refresh the jsp page in browser then the row is again unnecessarily inserted in the databse
+Pie Number of slices to send: Send
 

Originally posted by Pranav Pal:
I have another problem..


Please open a new topic for new questions.
I can't beleive you just said that. Now I need to calm down with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


Reply locked
This thread has been viewed 1141 times.
Similar Threads
how can I set multiple attributes to a session object.
Is session attribute thread-safe?
how to get the username from session?
how to use session attribute
Session tracking in servlets
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:44:18.