|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-05-08 21:31 UTC] jani@php.net
[2009-05-11 15:11 UTC] jens at dutzi dot me
[2009-05-12 02:01 UTC] jani@php.net
[2010-03-17 10:04 UTC] vijay dot gupta2021 at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 06:00:01 2025 UTC |
Description: ------------ When forcing PHP to not use cookies for sessions, PHP doesn't recognize the existing session. Instead it will create a new one. Session files will be created as expected. The Bug can be reproduced with: 1.) ini_set('session.use_cookies', 0); in the php-code and 2.) session.use_cookies = 0; in php.ini The following sample code is identical to http://www.php.net/manual/en/session.idpassing.php Reproduce code: --------------- <?php // Disable Cookie-Usage ini_set('session.use_cookies', 0); // Start the session session_start(); if (empty($_SESSION['count'])) { $_SESSION['count'] = 1; } else { $_SESSION['count']++; } ?> <p>Hello visitor, you have seen this page <?php echo $_SESSION['count']; ?> times.</p> <p>To continue, <a href="test.php?<?php echo htmlspecialchars(SID); ?>">click here</a>.</p> Expected result: ---------------- On the first run, a new session should be created with $_SESSION['count'] = 1. On everey reload $_SESSION['count'] should be increased. (s.a. example #1 at http://www.php.net/manual/en/session.idpassing.php) Actual result: -------------- On every run, PHP creates a new session with $_SESSION['count']=1.