This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Managing Session

 
AshishcKumar singh
Greenhorn
Posts: 9
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, each user has their own session.
 
AshishcKumar singh
Greenhorn
Posts: 9
  • 0
  • 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
Pie
Posts: 20188
26
MySQL Database
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alright!..
Thanks man..
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic