0

Is it possible to keep a PHP Session active when the user accesses the sub-domain of a site? Example: If a user visits www.example.com they're not logged in, but they're logged in on example.com

And, I want to make user profiles on username.example.com, but if I do that, they're not logged in for sub-domains.

I'm using the session_start(); function in php to handle the logins.

Axiom
  • 902
  • 1
  • 10
  • 23

1 Answers1

1

I would use cookies instead of sessions. They are very similar but will remain intact over subdomains.

luv2code
  • 1,216
  • 6
  • 22
  • 42