php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45258 session cookie doesn't work across domains while other cookies do
Submitted: 2008-06-13 12:42 UTC Modified: 2008-06-13 12:57 UTC
From: marek dot j at bia dot pl Assigned:
Status: Not a bug Package: Session related
PHP Version: 5.2.6 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: marek dot j at bia dot pl
New email:
PHP Version: OS:

 

 [2008-06-13 12:42 UTC] marek dot j at bia dot pl
Description:
------------
I want to use session across base domain and some subdomains.

Cookies set manually work fine, because when I use:

setcookie('test', '123456', 0, '/', '.domain.com');

I get proper value of $_COOKIE['test'] in base domain and across all subdomains (no matter if set this cookie in base or sub domain).
But when I use:

session_set_cookie_params(0, '/', '.domain.com');
session_start();

$_COOKIE['PHPSESSID'] has different value for base domain and another value for all subdomains (one value for all subdomains)

I think it's some bug in session_start() function, because setcookie() works fine and session_get_cookie_params() returns expected results (domain = '.domain.com').


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-13 12:57 UTC] marek dot j at bia dot pl
you should always remember to close and open your browser before sending any bug reports ;)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 08:01:34 2025 UTC