ID: 36661 Updated by: [EMAIL PROTECTED] Reported By: joshduck at hotmail dot com -Status: Open +Status: Bogus Bug Type: Session related Operating System: Windows XP PHP Version: 5.1.2 New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Must be your webserver changing the header. If you try your code with the CGI executable you'll see that PHP sends the header as intended. Previous Comments: ------------------------------------------------------------------------ [2006-03-09 07:54:48] joshduck at hotmail dot com Description: ------------ PHP does not accept alternative cookie domains set through either session_set_cookie_params or ini_set. My test machine runs two sub domains 'www.example.com' and 'alt.example.com'. In my script I have tried to set the cookie domain to '.example.com' (I've also tried 'example.com') so that both domains can access the cookie. When the cookie is sent to the browser the domain is set as the current domain ('www.example.com' or 'alt.example.com') rather than what I specified. I get the expected behaviour when I set session.cookie_domain in php.ini or when I manually set a cookie. Reproduce code: --------------- <?php session_set_cookie_params(6 * 3600, '/', '.example.com'); session_start(); print_r(session_get_cookie_params()); //Shows correct values echo ini_get('session.cookie_domain') . '<br />'; //Outputs '.example.com' echo $_SESSION['blah'] . '<br />'; $_SESSION['blah'] = rand(); ?> php.ini: session.use_cookies = 1 session.name = PHPSESSID session.auto_start = 1 session.cookie_lifetime = 0 session.cookie_path = / session.cookie_domain = session.serialize_handler = php session.cache_expire = 180 session.use_trans_sid = 0 session.hash_function = 0 session.hash_bits_per_character = 5 Expected result: ---------------- Cookie domain (in client): example.com Actual result: -------------- Cookie domain (in client): www.example.com ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36661&edit=1