Allow php sessions to carry over to subdomains

Here are 4 options.

Place this in your php.ini:

session.cookie_domain = ".example.com"

Or in your .htaccess:

php_value session.cookie_domain .example.com

Or as the first thing in your script:

ini_set('session.cookie_domain', '.example.com' );

Or in your php-fpm pool configuration for your site:

php_value[session.cookie_domain] = .example.com

Leave a Comment