I would like to store anonymous users $_SESSION in a cookie so that their cart and other custom information is still available even after closing the browser.
I found this interesting post which tells me I should add this to my local.settings.php:
ini_set('session.cookie_lifetime', 60 * 60 * 24 * 7); ini_set('session.gc_maxlifetime', 60 * 60 * 24 * 7); ini_set('session.save_path', '/home/yoursite/sessions');
So that session cookie would be available for a week.
But it also stands that we should use
session_regenerate_id() elseway the cookie lifetime is not updated.
I could not find
session_regenerate_idin Drupal 7 source code, but I believe Drupal might already handle this from what I read in the code comments.
My questions are:
- is this a good approach to have persistent cookie sessions?
- do I need to add to my local.settings.php
Thank you very much for your advises