#26357 [Opn->Fbk]: session.cookie_domain problem with Mozilla and IE

From: Date: Sat, 22 Nov 2003 02:43:03 +0000
Subject: #26357 [Opn->Fbk]: session.cookie_domain problem with Mozilla and IE
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-50836@lists.php.net to get a copy of this message
ID: 26357 Updated by: sniper@php.net Reported By: dmachi at vt dot edu -Status: Open +Status: Feedback Bug Type: *General Issues Operating System: Linux PHP Version: 4.3.4 New Comment: Try removing the prepended dot in the domain: $cookie_domain = 'my.sub.domain'; Previous Comments: ------------------------------------------------------------------------ [2003-11-21 21:33:15] dmachi at vt dot edu Description: ------------ I have a small app in which I would like to use sessions, no different than many others I have written in the past. However, on this one I would like to set the cookie domain to a domain as opposed to a host. However, when I do so, it seems to not work in Mozilla and IE (it does however work in konqueror). I have tried setting the cookie_domain through ini_set and through session_set_cookie_params and through setcookie, all with the same result. If I don't set the domain, the cookie works fine (although only for that host of course). I have searched high and low for an answer to this but have been unable to turn up anything. Reproduce code: --------------- $cookie_domain = '.my.sub.domain'; // Set session parameters and start session ini_alter("session.gc_maxlifetime", "172800"); ini_alter( "session.entropy_file","/dev/random"); ini_alter( "session.entropy_length","512"); ini_set( "session.name",$session_name); ini_set( "session.cookie_domain", $cookie_domain); session_start(); Expected result: ---------------- I expect that the cookie will be set on the browser. It does get set in konqueror, but not in any other browser that I have access to (mozilla running in both linux and windows, and ie) Actual result: -------------- It never appears when I try to set the cookie_domain. If I don't set it, the cookie appears normally. Additionally, I can turn on the feature in mozilla to ask whether or not to accept each cookie it receives, I never even get the question when the domain is set. Note that the behavior is the same if I set the cookie_domain to the hostname as well. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26357&edit=1

« previous php.bugs (#50836) next »