0

It's a common feature on an authentification page to set flag "Remember me" or "Don't remember me". Ok, I have a session started for one year with user_id stored there. But if the user chooses to not remember him, and my usual session (+1 year) already started in the start-up section of my framework - how can I change it to a temporary one, that will be destroyed on browser close?

zzmaster
  • 318
  • 1
  • 5
  • 16
  • Does this answer your question? [Why i can not delete cookie using php?](https://stackoverflow.com/questions/48151411/why-i-can-not-delete-cookie-using-php) – Markus Zeller Jul 10 '22 at 12:55

1 Answers1

0

to destroy cookies after browser closed or tab close use in page .php :

if(isset($_POST['button_dontRemamberMe'])){
ini_set('session.cookie_lifetime', 0);
}

Note: all cookies in browser for this page will lost