Skip to content

Instantly share code, notes, and snippets.

@anibalardid
Created January 26, 2019 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anibalardid/edec562c190e9080355a17063c385f63 to your computer and use it in GitHub Desktop.
Save anibalardid/edec562c190e9080355a17063c385f63 to your computer and use it in GitHub Desktop.
Change session expiration
ini_set('session.cookie_lifetime', 60 * 60 * 24 * 7); // 7 day cookie lifetime
ini_set('session.gc_maxlifetime', 60 * 60 * 24 * 7);
ini_set('session.save_path', '/home/yoursite/sessions');
session_start();
setcookie('PHPSESSID','any id' , any time);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment