File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Log out Functionality for my Web Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Log out Functionality for my Web Application " Watch "Log out Functionality for my Web Application " New topic
Author

Log out Functionality for my Web Application

Nishant Kr
Greenhorn

Joined: Aug 07, 2008
Posts: 8
Hi All,
I have used simple JSP and java files to build my application. All the jsp files have included a 'header.jsp' file, in which there is a Log Out image button. After clicking this button, the page 'logOut.jsp' emerges. In this page, I am invalidating the session. But when I click either back button of IE, or 'backspace' key, I can still access all the pages.

I have used

<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">

and

<%response.setHeader("Cache-Control","no-cache");%>
<%response.setHeader("expires","0");%>
<%response.setHeader("Pragma","no-cache");%>

in all the pages to clear all the cache.

Please help me expire the pages once logged out.

Thanks in Advance......!
__________________
Nishant
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Search this forum , Its already discussed OR you may Googled it !


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Syednizar Kamal
Greenhorn

Joined: Jul 04, 2008
Posts: 15
when the user is login to your application store that username in session.
And in header.jsp check for not null aginst that session username object.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hi
----------------------------
<%response.setHeader("Cache-Control","no-cache");%>
<%response.setHeader("expires","0");%>
<%response.setHeader("Pragma","no-cache");%>
----------------------------------------
looks good. you have to do some more work.you can not disable browser back button.but you can controll also you can disable right click and backspace button through java script...

for your problem ,there are many solution in javascript.

try google ;)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

"Nishant Kr", you have previously been warned on multiple occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional, and this is your final warning. Adjust your display name to comply with the required standards prior to your next post.

Failure to comply will result in the removal of your account.

bear
JavaRanch Sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Log out Functionality for my Web Application
 
Similar Threads
how to prevent caching in IE 6
Caching is not working
After Logout still keeping session
How to prevent caching of jsp pages?
dynamic JSP pages are not getting refreshed