Freelance Forums

Full Version: Sign Out code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can anyone help me with signout code in php

say if i do this

setcookie('uname',$_POST['uname']);
after successful login authentication...no problem with that
and ther is a script called "logout.php" called when user click on logout
if i use
setcookie('uname');

isset($_COOKIE['uname']) returns true..
is there any way to unset or delete the cookie when isset($_COOKIE['uname']) would return false
You can try two things

1) setcookie('uname','', time()-1000);

or

2) unset('uname')

Let me know if you have any questions
Thanks, it worked
Reference URL's