Revos Posted August 31, 2006 Share Posted August 31, 2006 How can I delete a cookie when I close page or change address?example I got page named X, when I close that page or change address to anyother I want to delete cookie name Y, how? Link to comment https://forums.phpfreaks.com/topic/19282-delete-a-cookie-when-page-closes-how/ Share on other sites More sharing options...
Orio Posted August 31, 2006 Share Posted August 31, 2006 From PHP.netsetcookie ( string name [, string value [, int expire [, string path [, string domain [, bool secure [, bool httponly]]]]]] )expire- If not set, the cookie will expire at the end of the session (when the browser closes).See more at [url=http://www.php.net/manual/en/function.setcookie.php]setcookie()[/url]Orio. Link to comment https://forums.phpfreaks.com/topic/19282-delete-a-cookie-when-page-closes-how/#findComment-83631 Share on other sites More sharing options...
Revos Posted August 31, 2006 Author Share Posted August 31, 2006 I have a problem:I got page name X and it creates a cookie and opens page named Yin page Y I check it cookie exists.now if I dont put expire it deletes the cookie when I close page X and open page Y.I want to create a cookie in page X(I know how)I want to delete a cookie when I close page Y(how?) Link to comment https://forums.phpfreaks.com/topic/19282-delete-a-cookie-when-page-closes-how/#findComment-83639 Share on other sites More sharing options...
onlyican Posted August 31, 2006 Share Posted August 31, 2006 Use sessions if u want it to finish when the browser closes Link to comment https://forums.phpfreaks.com/topic/19282-delete-a-cookie-when-page-closes-how/#findComment-83643 Share on other sites More sharing options...
Revos Posted August 31, 2006 Author Share Posted August 31, 2006 Tried it already...listen I got 2 pages, with page 1 I create a cookie\session.With page 2 I will check if the cookie\session exists.I want to create a cookie\session with page1 and close page1 and open page2, with page2 to check if cookie\session exists then show example.."blabla" and when I will close page2 the cookie\session will be deleted...is it possible? Link to comment https://forums.phpfreaks.com/topic/19282-delete-a-cookie-when-page-closes-how/#findComment-83646 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.