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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password problem

Status
Not open for further replies.

Elmserv

Programmer
Sep 25, 2004
72
GB
I have two identical web areas
The initial screen asks for username & password (on both)

On the development area the computer has started to "remember" the password.

This is my accounts & I often work on site then generate the invoice using any computer that has access to the web & a printer.

When I have finished I logout which destroys the session.

I assume I am getting a cookie & I need to overwrite it on logout to prevent any security breaches.


Richard
 
you're not giving us a lot to go on...

to log out of a sessions based login system you might try the following:

Code:
function logout(){
 if (session_name =="") {session_start();} //if the session is not started, then start it
 $_SESSION = array(); //delete the data in the session array
 session_destroy;  // destroy the session in memory
 setcookie(session_name(), '', time()-3600, '/'); //remove the session_id stored in the session cookie on the client machine
}
 
Hi I wasn't too far away, was I !!

Code:
<?php
if(session_id() == "") {session_start(); } 
session_destroy();
$redirecturl = "../index.php";
header("Location: $redirecturl");
?>
 
Thanks for your help. Another couple of years & I might get the hang of it


Regards


Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top