Jump to content

Recommended Posts

Hi there,

After using some references from php.net and looking at some examples i found for the logout script to destroy a cookie, i still failed in getting the cookie destroyed.

This is what happens i go to the login page type in my login details then it runs the login script once validated it passes the me to the members area page when i click on Logout it should log out however, it does not.

[code]
<?php

//this makes the time in the past to destroy the cookie
setcookie(ID_my_site, gone, time() - 3600);
setcookie(Key_my_site, gone, time() - 3600);

?>
[/code]

Please if you have anu suggestions or ideas why it doesn't work let me know.

Thank you in advance :)
Link to comment
https://forums.phpfreaks.com/topic/29085-cookie-destroy-problem/
Share on other sites

The cookie is set in the login script and here it is:

[code]$_POST['username'] = stripslashes($_POST['username']);

setcookie(ID_my_site, $_POST['username'], time() + 3600);
setcookie(Key_my_site, $_POST['pass'], time() + 3600);[/code]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.