You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "MARU, SOHIL (SBCSI)" <sm...@sbc.com> on 2004/04/27 21:23:45 UTC

Handling sessions

Hello All,
    I am trying to do session handling by creating a custom request
processor. When someone clicks on the logout link on my site, I 

			HttpSession sess = req.getSession();
			sess.invalidate();			


In my login action

			HttpSession sess = req.getSession(true);

In the preprocess method of my request Processor, I have the following.
			HttpSession sess = req.getSession(false);	
			if(sess == null)	
				System.out.println("sess is null");
			else			
				System.out.println("sess IS THERE");

However even when I click on logout and try logging in again using, it
prints 

Sess IS THERE, thus I am wondering how to figure out whether a user is
logged in or not. I thought that if a user is not logged in, for the
first URL Request, sess would be null in my request processor.

Thanks,
Sohil

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org