Skip to content Skip to sidebar Skip to footer

Sharing Session Data Across Domains With Php

My user is logged in at site_url.com on a CMS, however I am now developing a mobile version of the site, outside the CMS on a subdomain m.site_url.com and would like the session to

Solution 1:

You need to set the cookie's domain accordingly - add a . to your domain name:

session_set_cookie_params(0, '/', '.site_url.com');

This will share your cookie across all of your sub domains and the second level domain.

Post a Comment for "Sharing Session Data Across Domains With Php"