• 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

Log out Functionality for my Web Application

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Search this forum , Its already discussed OR you may Googled it !
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ;)
 
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
"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
reply
    Bookmark Topic Watch Topic
  • New Topic