note 117771 added to function.session-set-cookie-params

From: Date: Thu, 06 Aug 2015 09:25:19 +0000
Subject: note 117771 added to function.session-set-cookie-params
Groups: php.notes 
Request: Send a blank email to php-notes+get-203273@lists.php.net to get a copy of this message
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.. ---- Server IP: 72.52.91.14 Probable Submitter: 59.174.94.169 ---- Manual Page -- http://php.net/manual/en/function.session-set-cookie-params.php Edit -- https://master.php.net/note/edit/117771 Del: integrated -- https://master.php.net/note/delete/117771/integrated Del: useless -- https://master.php.net/note/delete/117771/useless Del: bad code -- https://master.php.net/note/delete/117771/bad+code Del: spam -- https://master.php.net/note/delete/117771/spam Del: non-english -- https://master.php.net/note/delete/117771/non-english Del: in docs -- https://master.php.net/note/delete/117771/in+docs Del: other reasons-- https://master.php.net/note/delete/117771 Reject -- https://master.php.net/note/reject/117771 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#203273) next »