Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

same session across different subdomains

Explorer ,
Apr 11, 2012 Apr 11, 2012

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

TOPICS
Server side applications
673
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2012 Apr 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 12, 2012 Apr 12, 2012
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines