extend the lifetime of cookies on your site


Who wants to extend the lifetime of cookies on their site, then put this line

PHP:
setcookie(session_name(),session_id(),strtotime('+1 year'),"/");

In the document index.php which lies at the root of the site.

After the line

PHP:
session_start();

Accordingly, after that, the basket and all the buns will live there for a year, even after restarting the computer =)

Go back
14-11-2022, 13:12