Jump to content

Archived

This topic is now archived and is closed to further replies.

Revos

Delete a cookie when page closes - how?

Recommended Posts

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?

Share this post


Link to post
Share on other sites
From PHP.net

setcookie ( 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.

Share this post


Link to post
Share on other sites
I have a problem:
I got page name X and it creates a cookie and opens page named Y
in 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?)

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

×

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.