Forums Register Login

HttpSession concept

+Pie Number of slices to send: Send
Hi, i'm getting weird things on my user sessions, so i was wondering...
...Is the HttpSession thread-safe?
I'm having users objects 'setted' on other users sessions, so, may it be that i need to enclose the code in a 'synchronized' block?
I'll appreciate any help...
R
+Pie Number of slices to send: Send
Sessions are not automatically Thread-safe, but should be unique to individual users. Confusion of objects between users is almost certainly due to bad program architecture and will not be helped by synchronization.
The only time you should have to worry about synchronizing access to objects in sessions is when you have the possibility of processing multiple requests from the same user "at the same time" - for example with frames or where images are being generated.
Bill
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 763 times.
Similar Threads
Duplicate Login
Terminate others session by session id
Session Interference
Getting active session from the session id
Accessing session of another user
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 06:16:03.