Results 1 to 6 of 6
Thread: session invalidation
- 07-22-2012, 04:17 PM #1
Member
- Join Date
- Jan 2012
- Posts
- 5
- Rep Power
- 0
session invalidation
Hello guyz..
i recently developed a project on employee management in JSP.I am really bad at the session handling.Can any one please help me implement a logout page to my application.
Links,sample codes,.... any thing will be appreciable.
Actually i tried some sample codes , but most of them are fake.




- 07-22-2012, 09:06 PM #2
Re: session invalidation
Moved from New to Java
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 07-23-2012, 10:39 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Re: session invalidation
What have you tried?
What didn't work?
Any errors?Please do not ask for code as refusal often offends.
- 07-23-2012, 08:45 PM #4
Member
- Join Date
- Jan 2012
- Posts
- 5
- Rep Power
- 0
Re: session invalidation
Java Code:<%-- Document : log_out Created on : Jul 12, 2012, 10:39:53 AM Author : Sarath --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body> <% System.out.println("USER NAME : "+session.getAttribute("username")+"PASS WORD : "+session.getAttribute("password")); session.setAttribute("username",null); session.setAttribute("password",null); session.invalidate(); %> <jsp:forward page="login.jsp"/> </body> </html>
I tried this code.When i click on "Log out" button , the above code executes and , my page will be forwarded to the "login.jsp" page !!
But the problem is , even if i click on the "logout" button , when i try the "back" button to go back to the previous page it works fine.
And i dont want this to be happen.Even if the logout is clicked , if a user can go back to his previos page then there is no meaning of putting a logout button.
I personally thinks so...
Please help me here with your valuable suggestions....
Thanx in advnc..Last edited by Tolls; 07-24-2012 at 09:25 AM. Reason: Fix code tags
- 07-23-2012, 10:56 PM #5
Re: session invalidation
Why do they call it rush hour when nothing moves? - Robin Williams
- 07-24-2012, 09:27 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Re: session invalidation
That's nothing to do with invalidate.
Do you have interceptors or anything in your servlets that checks for whether someone is logged in on each page they can hit?
Do you have the html headers set so the browser doesn't cache the page?
If neither of those things are done then how do you expect the server to know not to allow someone back to that page?Please do not ask for code as refusal often offends.
Similar Threads
-
How to Invalidate back navigation in browser after session invalidation
By krishnareddy in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 01-31-2012, 08:17 AM -
problem in session invalidation.
By Jagdeesh123 in forum Java ServletReplies: 3Last Post: 12-06-2010, 04:05 PM -
How to Kill session at application context level by using session Id
By Kishore.Kumar in forum Java ServletReplies: 1Last Post: 04-21-2009, 11:20 PM -
[SOLVED] Access to default session deniedAccess to default session denied
By jazz2k8 in forum NetworkingReplies: 1Last Post: 03-10-2009, 01:12 PM -
How do I create session for a user when S/he login and expire the session.
By dpk_vash in forum Web FrameworksReplies: 2Last Post: 12-23-2008, 06:35 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks