Hi friends,
I am trying to develop a web application in which I have provided a facility for login and logout. I can allow user to log in succesfully, but when user clicks on the logout link and comes to login page and after that if he presses the browser's BACK button, he is directed to the previous page.I don't want to use any javascript function like history(). please provide some sample code of one or 2 pages.please????
vishalbhavsar
-3
Newbie Poster
Recommended Answers
Jump to PostWhen you login, put the user name into the session:
session.setAttribute("USERNAME", <username_of_the_user>);
When you log out remove it:session.setAttribute("USERNAME", null);
And in every page take the USERNAME from the session and check if it's null. If it is then who ever went to that page hasn't login:
All 3 Replies
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
vishalbhavsar
-3
Newbie Poster
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.