File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes How to check if session is active or not? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to check if session is active or not?" Watch "How to check if session is active or not?" New topic
Author

How to check if session is active or not?

Abhishek Asthana
Ranch Hand

Joined: Sep 08, 2004
Posts: 146
Hi,
I am making a shopping site. I want that when customer first presses
"Add to Cart" button, then he is shown login page and for every next click his item is added to the cart.
I want to know how can we find that user has already logged in? Also I want that once user has logged in, he is redirected to same page from where he come.
Please tell me how we do this?
Thanks.
Abhishek
Geeta Ramasami
Ranch Hand

Joined: Mar 05, 2003
Posts: 72
You can store a flag in the session after the user logs in.
When the user logs out the flag can be removed from the session.Based on the presence of the flag you would know if the user has already logged in.
If so you can redirect accordingly.
Is this the one you are lokking for.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to check if session is active or not?