From: dmachi at vt dot edu
Operating system: Linux
PHP version: 4.3.4
PHP Bug Type: *General Issues
Bug description: session.cookie_domain problem with Mozilla and IE
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 bug report at http://bugs.php.net/?id=26357&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=26357&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=26357&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=26357&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=26357&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=26357&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=26357&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=26357&r=support
Expected behavior: http://bugs.php.net/fix.php?id=26357&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=26357&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=26357&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=26357&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26357&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=26357&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=26357&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=26357&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26357&r=float