wood burning stoves 2.0*
The moose likes Struts and the fly likes sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "sessions" Watch "sessions" New topic
Author

sessions

sharathchandra sabbani
Greenhorn

Joined: Oct 15, 2007
Posts: 13
when ever user logs into the system i want to create a session for the user.how to do this...
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Your web server and/or application server pretty much does this for you. Do you have specific questions or issues?

- Brent
andres matus
Greenhorn

Joined: Dec 21, 2007
Posts: 15
you can put a user object in the request session...that way you have the user information all over your app.

use this....
//setting the user information on the session
request.getSession().setAttribute("UserSession",UserObject);

//reading the user information from the session
UserObject user = (UserObject)request.getSession().getAttribute("UserSession");


Be free...do what ever you whant
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: sessions