Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What HTML Command Do I need to use to close a Browser Session ?

Status
Not open for further replies.

rthorpe3

MIS
Jun 18, 2002
1
GB
I have a Web based application that has a logout button avaliable to the user.

At the moment if you click the logout button it takes you back to the login screen. I want to change this though so when the user clicks the logout button it close that particular browser session.

Is this possible and if so what is the command ?

The html at the moment looks like this, on logout it takes the user to the page, how do I make kill that browser session ?

function logout()
{
mydt = new Date();
top.wilogoutstatusbar.location.href ="%SCRIPT_NAME%/WIGenerator/wigenerator/g
enerator/Logout?cnt="+mydt.getTime();

setTimeout("top.location.href =\");

return;
 
You can't do that with html. If your site supports php, you can do this:

<a href=&quot;logout.php&quot;>Logout</a>

logout.php
--------------------------------------------------
<?
session_destroy();
?>

<center>
You have successfully logged out. Come back soon :)<br />
<a href=&quot;login.php&quot;>Login</a>
</center>
---------------------------------------------------

Rick It's a pleasure to know that I've helped you. If I have,
please click the link below to let me know. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top