This topic is locked

Unsetting cookies

6/5/2009 7:03:10 PM
PHPRunner General questions
G
giles author

Having problems unsetting cookies whenever the phprunner login screen is displayed.
The cookies are set correctly on successful login (providing theusers access to another application) and when they sign out of that application they are redirected back to the phprunner login page.
I set the cookies in an after successful login event using:

setcookie("mycookieone", $user, 0, "/", ".mydomainname.com");

setcookie("mycookietwo", $key, 0, "/", ".mydomainname.com");

This works fine.
To unset the cookies:

setcookie('mycookieone', '', time() -42000, '/', '.mydomainname.com');

setcookie('mycookietwo', '', time() -42000, '/', '.mydomianname.com');
I've tried this in various events on the login page including: onload, before process, before display

and even as a code snippet placed before the "<!DOCTYPE HTML PUBLIC..." line of the display in the visual editor. I either get a php error "cannot modify header - header info already sent...". Or the code runs but the cookies are not deleted.
Any advice?