|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-11-21 21:43 UTC] sniper@php.net
[2003-11-21 22:10 UTC] dmachi at vt dot edu
[2003-11-25 15:52 UTC] iliaa@php.net
[2003-12-01 03:15 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 16:00:01 2025 UTC |
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.