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? Quote Link to comment 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. Quote Link to comment 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?) Quote Link to comment 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 Quote Link to comment 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.