Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

How to disable the back button after logout

This is a discussion on How to disable the back button after logout within the JSP forums, part of the Web Development category; Hi, I wrote the code for logout in jsp.. But I dont know how to disable the back button.. Or give any other solution for this.. I had seen many ...

Go Back   Geeks Talk > Web Development > JSP
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

JSP JSP Related Issues and Problems

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-24-2008
Junior Member
 
Join Date: Dec 2008
Location: Chennai
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Jyothi Thangavel is on a distinguished road
How to disable the back button after logout

Hi,

I wrote the code for logout in jsp.. But I dont know how to disable the back button..
Or give any other solution for this.. I had seen many forums. But still I didn't get the solution. Please help me...
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-24-2008
Junior Member
 
Join Date: Aug 2008
Location: Chennai
Posts: 14
Thanks: 1
Thanked 0 Times in 0 Posts
pmsudha is on a distinguished road
Re: How to disable the back button after logout

Hi Jyothi,
No need to disable the back button... What u should do is just to redirect the same page when u click back button...

for Ex...
Consider you are having Logout.jsp, use the following script within your <head> Tag...
<script type="text/javascript">
window.onunload = unloadPage;
function unloadPage()
{
document.FrmLog.action="SN_LogoutDisp.jsp";
document.FrmLog.submit();
}
</script>


I tried this... It worked...
Reply With Quote
  #3 (permalink)  
Old 09-24-2009
Junior Member
 
Join Date: Sep 2009
Location: surat
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
tjs_klh is on a distinguished road
Re: How to disable the back button after logout

i used this code.. it isnt working...
can u please explain me in detail about how should i use this code (with an example)?
Reply With Quote
  #4 (permalink)  
Old 09-25-2009
Expert Member
 
Join Date: May 2009
Location: Bangalore
Posts: 984
Thanks: 155
Thanked 420 Times in 201 Posts
rijus is just really nicerijus is just really nicerijus is just really nicerijus is just really nicerijus is just really nice
Re: How to disable the back button after logout

Hi,

Try this code...

<%
response.setHeader("Pragma","no-cache");
response.setHeader("Cache-Control","no-store");
response.setHeader("Expires","0");
response.setDateHeader("Expires",-1);
%>

OR

<script language="JavaScript" type="text/javascript">
window.history.forward(1);
</script>

Regards,
Rijus.
Reply With Quote
Reply

  Geeks Talk > Web Development > JSP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to write the coding for logout in jsp? pmsudha JSP 1 12-26-2008 09:43 AM
Disabling back button manatworkk007 ASP.NET 1 07-01-2008 02:30 AM
Why logout does not work in ASP.NET ahsanm ASP.NET 2 03-15-2008 05:18 PM
AJAX and the Back Button Problem Lokesh M AJAX & XML 0 02-10-2008 04:57 AM
Javascript for disabling back button Mahesh Shelar JavaScript 0 02-07-2008 05:59 AM


All times are GMT -4. The time now is 06:25 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved