Skip to main content
Known Participant
April 12, 2012
Question

same session across different subdomains

  • April 12, 2012
  • 2 replies
  • 672 views

How do I create a session so that it will work across different subdomains on my website?

This topic has been closed for replies.

2 replies

April 13, 2012

Add this before you start your session:

ini_set("session.cookie_domain", ".your_domain.com");

This will allow session variables travel trough your subdomains.

You can also change your php.ini file but it will affect the whole server permanently.

Community Expert
April 12, 2012

I think you are going to have to store that information as a cookie if it will be used in sessions across mulitple domains.