• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Maintaining sessions

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi friends i have created a web application using netbeans 6.0

When a user loggs in the data is sent from Login page to a servlet which in turn communicates with a bean. if the user id and password are valid the servlet creates a session and sets the attribute as follows

HttpSession session = request.getSession();
session.setAttribute("uname",uname);

And forwarding it to a new jsp called Welcome.jsp . and on Welcome.jsp i am checkin the attribute value from session object.
Now on Welcome.jsp if i press back (on browser) my Login page is displayed. and then if i press forward button (on browser) the Welcome.jsp is displayed even if the user id and password is not entered. How do i handle the sessions?
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sonam Zam

write small java code on the login page that invalidate the whole session.
 
If you are using a rototiller, you are doing it wrong. Even on this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic