Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sessions

 
sharathchandra sabbani
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when ever user logs into the system i want to create a session for the user.how to do this...
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your web server and/or application server pretty much does this for you. Do you have specific questions or issues?

- Brent
 
andres matus
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic