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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 22:01:31 2024 UTC