php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26502 session_start() sends session cookie at every request
Submitted: 2003-12-02 14:12 UTC Modified: 2003-12-02 14:49 UTC
From: mccarthy36 at earthlink dot net Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.3.4 OS: Linux 2.4.20-20.7
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: mccarthy36 at earthlink dot net
New email:
PHP Version: OS:

 

 [2003-12-02 14:12 UTC] mccarthy36 at earthlink dot net
Description:
------------
session_start() is sending the session cookie at every request, and Internet Explorer 6 hangs indefinitely the third time that happens.  This is with PHP 4.3.4 (module) / Red Hat Linux 7.3 2.96-113 (kernel 2.4.20-20.7) / Apache 1.3.29. 

This problem seems to bear some relation to the problem reported in bug #22771, though I am NOT using session_id(), as described in that report.  Also similar is #25894, but that was marked as bogus.

The code fragment exhibits the problem on my system, described above.  The same code on PHP 4.3.0 (module) / Slackware Linux (kernel 2.4.12) / Apache 1.3.26 works fine -- the session cookie is only sent on the first request.

Reproduce code:
---------------
ini_set( 'session.name', 'MyCookieName' );
ini_set( 'session.save_handler', 'files' );
ini_set( 'session.auto_start', '0' );
ini_set( 'session.gc_maxlifetime', '3600' );
ini_set( 'session.gc_probability', '5' );
ini_set( 'session.serialize_handler', 'php' );
ini_set( 'session.cookie_lifetime', '0' );
ini_set( 'session.cookie_path', '/' );
ini_set( 'session.cookie_domain', '.YOURDOMAIN.com' );
ini_set( 'session.use_cookies', '1' );
ini_set( 'session.use_only_cookies', '1' );
ini_set( 'session.cache_limiter', 'nocache' );
ini_set( 'session.cache_expire', '60' );
ini_set( 'session.use_trans_sid', '0' );

session_start();

Expected result:
----------------
I expect the session cookie 'MyCookieName' to be set on the first request, only.

Actual result:
--------------
'MyCookieName' is set with each request.  Internet Explorer 6 / Win chokes the third consecutive time this happens.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-02 14:24 UTC] sniper@php.net
Any modern browser has support for cookies. If IE doesn't, too bad.

 [2003-12-02 14:49 UTC] mccarthy36 at earthlink dot net
Why has that behavior changed in PHP?  As has been mentioned, the new behavior serves no purpose.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 15:01:34 2025 UTC