X10nD
X10nD

Reputation: 22030

session for sub-domain.example.com using PHP

I have setup .htaccess to redirect me.example.com to example.com/fun/index.php. This index.php has a session. When a user is on me.example.com/index.php the session is never enabled, but is enabled on example.com/fun/index.php.

How do I enable session on me.example.com/index.php path.

Upvotes: 0

Views: 235

Answers (2)

Sim
Sim

Reputation: 2725

session_set_cookie_params(3600, '/', '.example.com');
session_start();

Upvotes: 1

Ashraf
Ashraf

Reputation: 2632

ini_set('session.cookie_domain', '.example.com' );

Upvotes: 2

Related Questions