Jump to content

Maintaining Sessions Across Sub-Domains


setacity

Recommended Posts

I want my PHP session to be maintained as I move to between sub-domains.  This works in IE7, Opera, Safari, and Chrome, but not in Firefox 3.

 

There are two links below.  The intended result is that they should both print the same session_id to the screen.

 

What am I doing wrong?

 

http://www.schedulepanda.com/simpleTest1.php

<?
session_set_cookie_params(0 , '/', '.schedulepanda.com'); 
session_start();
print session_id();

print '<a href="http://app.schedulepanda.com/simpleTest2.php" />test 2</a><br/>';

if ( !defined('COOKIE_DOMAIN') ) print_r(session_get_cookie_params());
?>

 

http://app.schedulepanda.com/simpleTest2.php

<?
session_set_cookie_params(0 , '/', '.schedulepanda.com'); 
session_start();
print session_id();

print '<a href="http://www.schedulepanda.com/simpleTest1.php" />test 1</a><br/>';

if ( !defined('COOKIE_DOMAIN') ) print_r(session_get_cookie_params());
?>

Link to comment
https://forums.phpfreaks.com/topic/124867-maintaining-sessions-across-sub-domains/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.