Re: Rookie question about Sessions
Monday, March 18, 2002 02:01 PM
If you are doing your work from servlets you will probably use the following lines to set and get session variables:
request.getSession().putValue( "some.id.here", userId );
userId = (String) request.getSession().getValue( "some.id.here" );
where request is the servlet's HttpServletRequest.
If you are using JSP's, you can refer directly to the session with the "session" property inherent to JSP's.
session.putValue( "some.id.here", userId );
For more information, check out the javadoc pages on HttpSession. -HTH Ed