my dog learned polymorphism*
The moose likes Servlets and the fly likes Session expires ,user session expires when online Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session expires ,user session expires when online" Watch "Session expires ,user session expires when online" New topic
Author

Session expires ,user session expires when online

supriya riya
Ranch Hand

Joined: Feb 23, 2009
Posts: 41
I check for session value on jsp page and its null,so session expires and it shows the related page asking for login again,online.But on local host it works fine.
I am using a cache manager class,in it caching attribute value of "loginid",which i check for session expires or not in jsp.But problem is how do i get "loginid" which i take from jsp



from servlet to cacheManager.java



in servlet i use setAttribute and set searchcategory taken from cacheManager.Above code worked fine,solved my problem of online search.but i want single "loginid" value from Servlet which i took from jsp shown above, in cacheManager.java
so that i can

cacheMap.put(loginid, loginid1);

Correct me if i am wrong,anywhere.
supriya riya
Ranch Hand

Joined: Feb 23, 2009
Posts: 41
So how to i get the value from servlet to .java class,and set attribute successfully so as to pass it to my jsp.
supriya riya
Ranch Hand

Joined: Feb 23, 2009
Posts: 41
hi,i have got the values from cacheManager and set it in session.setAttribute.The "loginid" which i check for session expired.But User still cannot maintain session when website runs online.
Help will be greatly appreciated.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3817

supriya riya wrote:I am using a cache manager class,in it caching attribute value of "loginid",which i check for session expires or not in jsp.But problem is how do i get "loginid" which i take from jsp


Your logic is not that clear to me. How you obtain the session for a client?

SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Saifuddin Merchant
Ranch Hand

Joined: Feb 08, 2009
Posts: 597

I still don't understand your question...


Cheers - Sam.
Twisters - The new age Java Quiz || My Blog
supriya riya
Ranch Hand

Joined: Feb 23, 2009
Posts: 41
In loginhandler.Values on this servlet come from index.jsp.



this is section handling particular user logins.

In adminhome.jsp for admin login.It logs in sucessfully.But after logging in when i click other links like update admin etc,it shows session expired.



Problem is on localhost my user sessions are maintained,but when i deploy war file online it does not maintain user session.It goes to session expired page when i click any other jsp page link.
Do i need to post more details.
Frank Eichfelder
Ranch Hand

Joined: Aug 25, 2003
Posts: 33
Perhaps you have enabled Session-Cookies for Localhost, but not for the Remote-System in your browser-settings.
In your Source-Code, you do not have any statements for URL-Rewriting when cookies are disabled, so without session-cookies your application will lose the session every time the user clicks on a link.
 
 
subject: Session expires ,user session expires when online
 
Similar Threads
Session
Problem retrieving session value in jsp pagess
Session expiry in servlet
Killing a session in a servlet!!
Simple java bean problem