1. Computing

Discuss in my forum

Session_set_cookie_params () PHP Function

By , About.com Guide

Definition: Session_set_cookie_params () is used to set information about the session cookie, including the duration. It is phrased as session_set_cookie_params (seconds, optional_path, optional_domain, optional_security). This is not as effective as editing the php.ini file, and only lasts for the duration of the script, so you would need to call it on every page before session_start().
Also Known As: Set Session Cookie Duration
Examples:
 //sets cookie to 1200 seconds or 20 mins 
 session_set_cookie_params(1200); 
 session_start(); 
 
  1. About.com
  2. Computing
  3. PHP / MySQL
  4. PHP Functions
  5. Session Cookies - Session Cookie Length - Session Set Cookie Params

©2013 About.com. All rights reserved.