note 117771 rejected from function.session-set-cookie-params by cmb

From: Date: Thu, 06 Aug 2015 10:07:25 +0000
Subject: note 117771 rejected from function.session-set-cookie-params by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-203275@lists.php.net to get a copy of this message
Note Submitter: 376292871 at qq dot com ---- oh, I found a strange thing. If I use session_set_cookie_params function to add the param $domain, no matter what domain is, the front of domain will always be add a dot. Test domain: example.com As follow: <?php $lifetime = 24 * 60; session_set_cookie_params($lifetime, '/', $_SERVER['HTTP_HOST']); session_start(); exit; ?> the cookie show as follow: Name: PHPSESSID Value: l1lvu4j89nodfipt0vejik3um6 Domain: .example.com Test domain: www.example.com As follow: <?php $lifetime = 24 * 60; session_set_cookie_params($lifetime, '/', $_SERVER['HTTP_HOST']); session_start(); exit; ?> the cookie show as follow: Name: PHPSESSID Value: m5g95dtcit81t93enai8j560e0 Domain: .www.example.com My god! god give me a dot , but I don't want to own it..

« previous php.notes (#203275) next »