• 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

Regarding sessions and cookies

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I created one web page in jsp.
In that i want to keep track of the username entered in the login page.

i tried with the following code but it's not working after 3 r more pages
i want to keep track till the user logout.
the code is used is
String name=request.getParameter("username");
session.setAttribute("usernamesession",name);



and in the next page i retrieved
lik this
out.println(session.getAttribute("usernamesession"));
Its working fine in for 3 pages after that it s displaying null value.
can anyone tell me how to keeptrack of the username until the user logout
thanx a lot
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Santhana Lakshmi.S:
Its working fine in for 3 pages after that it s displaying null value.



It could be because of session timed out. Did you check the session-timeout value in web.xml?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A session timeout is an unlikely culprit as the act of navigating between the pages will reset the session timer. A session timeout will only occur if there a prolonged period of inactivity between actions that exceeds the length of the session timeout value.
 
Heonkoo Lee
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, it is unlikely unless the inactivitity time between navigation is more than time out value.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic