0

I want to use my main domain session in subdomain for example

main domain : example.com
subdomain : xyz.example.com

session : $_SESSION['username']

user login in main domain and generate $_SESSION['username']

now i want to auto login in subdomain and work same session variable in my subdomain.

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
bizz website
  • 85
  • 2
  • 8
  • @fred how can i use ini_set('session.cookie_domain', '.example.com' ); – bizz website Aug 23 '17 at 12:25
  • just like that it's a global PHP function!? Or set the `session.cookie_domain` value in your php.ini file on the server directly. – xander Aug 23 '17 at 12:27
  • @xander thank you for reply ... i already write it in php.ini like this session.cookie_domain = '.example.com' and write before session like ini_set('session.cookie_domain', '.example.com' ); – bizz website Aug 23 '17 at 12:31

0 Answers0