0

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.

Ates Goral
  • 137,716
  • 26
  • 137
  • 190
X10nD
  • 21,638
  • 45
  • 111
  • 152

2 Answers2

2
ini_set('session.cookie_domain', '.example.com' );
Ashraf
  • 2,612
  • 1
  • 20
  • 35
  • Don't forget to add session_start(); at the head of the page , and try to replace the string .example with your sub domain – Ashraf Jan 29 '12 at 07:04
  • Have a look here : http://stackoverflow.com/questions/4631803/php-multi-domain-sessions-ini-set-not-working – Ashraf Jan 29 '12 at 07:06
1
session_set_cookie_params(3600, '/', '.example.com');
session_start();
Sim
  • 2,627
  • 1
  • 20
  • 21