Skip to content

Instantly share code, notes, and snippets.

@anibalardid
Created January 26, 2019 20:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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