tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anand Prasad <>
Subject Creating and Handling Session variables in jakarta
Date Wed, 11 Oct 2000 01:22:14 GMT
Hi All,

I am using Apache and Jakarta.  I would like to create session variable for
each user so that I can have them for the life of the session.

Here Snippet of my code in login.jsp
	      boolean hasAccess = login.checkPassword(userId , passwd);
		/* Get the revelant information about the user & create
		   session variables */
		//HttpSession session = request.getSession(true)

		HttpSession session = request.getSession(false);
		session.putValue("loginId", userId);

request.getSession(false) will give me the existing session.  I am getting
session already exists.  If I changed to request.getSession(true) it is
gives me error saying that session already exists.

Could anyone kindly explain me how does tomcat handle sessions.   My Goal is
to create 5 session variable for each session and use it in every page.

Thanks in Advance.


View raw message