Jump to content

Deleting cookies


Plain Flailing

Recommended Posts

I've searched through a number of threads on this topic, but none have seemed to help.

 

I'm having trouble deleting a cookie. I can set it fine like this:

 

setrawcookie("username", $username, time()+3600);

 

But I can't delete it like this:

 

setrawcookie("username", "", 1);

 

I've also tried adding a "/" in the domain parameter:

 

setrawcookie("username", $username, time()+3600, "/");

setrawcookie("username", "", 1, "/");

 

If it matters, the cookie is set on the page mysite.com/login/index.php and is (theoretically) deleted on the page mysite.com/logout/index.php - could the directories be causing the problem? If not, where am I going wrong?

Link to comment
Share on other sites

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.