• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session expires ,user session expires when online

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?
 
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I still don't understand your question...
 
supriya riya
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Doe, a deer, a female deer. Ray, a pockeful of sun. Me, a name, I call my tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic