Forums Register Login

Logout user by deleting cookie

+Pie Number of slices to send: Send
here is how the cookie is detected

im trying to add a button, when clicked it kills the cookie, but so far no success
thanks
+Pie Number of slices to send: Send
public void Cookie.setMaxAge(int expiry)

Specifies the maximum age of the cookie in seconds before it expires. A negative value ( -1 ) indicates the default, that the cookie should expire when the browser exits. A zero ( 0 ) value tells the browser to delete the cookie immediately.

you can do one thing that on click of button , you can write the code ..

yourCookieName.setMaxAge(0);

It will delete the cookie immediately.
For my next trick, I'll need the help of a tiny ad ...
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 7179 times.
Similar Threads
Getting The Value From A Cookie To Use In An If Statement
Extracting Values From Single Cookie
change cookie value
Cookies
Cookie problem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:43:01.