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

Managing Session

 
AshishcKumar singh
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!

I am making a discussion forums site. I want to track user's using session object.
I am creating session as follows:-

String Username=request.getParameter("textuname");
session.setAttribute("userid",Username);

i am retrieving the value when required.

Doubt m having is that if on 'logout' by any user if i invalidate the session using session.invalidate(); wont it destroy sessions of all other users online???

What i need is tat only session of that particular user is destroyed and all others who are online can keep continuing with their tasks.

Thanks..
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, each user has their own session.
 
AshishcKumar singh
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi thanks for replying..

You mean there'll be automatic handling of each user's session??

Please explain me this:--

i am giving the session's name as "userid". On each user's pc..there'l a temporary cookie created by this session object named "userid" or what??..

How is it going to work?can you please explain me all this?..

thanks.
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't understand that. You said
i am giving the session's name as "userid"

But in your original post you showed an example of putting an attribute named "userid" into a session.

Here's what you need to know: the container will maintain a session for each user. You don't really need to know how it does that. Whether it uses cookies or URL-rewriting or ventricles, you don't care. You can have a session for each user.
 
AshishcKumar singh
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright!..
Thanks man..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic