Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can i delete or set max duration for which Cookie exists?

cookie delete duration exists Max
0
Posted

How can i delete or set max duration for which Cookie exists?

0

You can set the maximum age of a cookie with the cookie.setMaxAge(int seconds) method: Here are different options to this method, • Zero means to delete the cookie • A positive value is the maximum number of seconds the cookie will live, before it expires • A negative value means the cookie will not be stored beyond this browser session (deleted on browser close) Here is a sample code to delete cookie.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123