Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
A "Session" is a term referring to a user's time browsing a web site. It's meant to represent the time between a user's first page view on a particular site, until the time that user is finished at that site. PHP offers us the ability work with "session variables" which are available for the duration of a user's session
Learn more about Escaping Output
Documentation
Changing Session Timeout
By default the session timeout is 1440 seconds, which is 24 minutes. One of the most basic examples to change the session timeout is as follows:
// server should keep session data for AT LEAST 1 hour
ini_set('session.gc_maxlifetime', 3600);
// each client should remember their session id for EXACTLY 1 hour
session_set_cookie_params(3600);
session_start();
For more details on PHP settings, check out the course on Basic Error Handling in PHP.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up