note 73121 added to ref.session
| From: | Parikesit at osu1 dot php dot net | Date: | Fri, 09 Feb 2007 18:26:14 +0000 |
| Subject: | note 73121 added to ref.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-123181@lists.php.net to get a copy of this message | ||
localhost problem
-----------------
When using localhost and session.cookies not work, simply remove domain from session.cookie_domain.
We can use "session_set_cookie_params" function or ini_set to do this. Example:
$cookie_path = 'my_path';
$cookie_domain = 'localhost'; //or any valid domain
init_session_cookies($cookie_path, $cookie_domain);
//maybe we create new function for handling this
function init_session_cookies($path, $domain) {
if ($domain=='localhost') $domain='';
if (function_exists('session_set_cookie_params')) {
session_set_cookie_params(0, $path, $domain);
} else {
ini_set('session.cookie_lifetime', '0');
ini_set('session.cookie_path', $path);
ini_set('session.cookie_domain', $domain);
}
}
Best,
Parikesit (zae_lokamaya #at# yahoo #dot# co #dot# uk)
----
Server IP: 69.147.83.197
Probable Submitter: 125.163.36.19
----
Manual Page -- http://www.php.net/manual/en/ref.session.php
Edit -- https://master.php.net/note/edit/73121
Del: integrated -- https://master.php.net/note/delete/73121/integrated
Del: useless -- https://master.php.net/note/delete/73121/useless
Del: bad code -- https://master.php.net/note/delete/73121/bad+code
Del: spam -- https://master.php.net/note/delete/73121/spam
Del: non-english -- https://master.php.net/note/delete/73121/non-english
Del: in docs -- https://master.php.net/note/delete/73121/in+docs
Del: other reasons-- https://master.php.net/note/delete/73121
Reject -- https://master.php.net/note/reject/73121
Search -- https://master.php.net/manage/user-notes.php