|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-12-19 12:12 UTC] kamil at kube dot org
Description:
------------
Hi,
once I've updated first to 5.0.3 and now also to the latest snapshot, I get "illegal character errors" when starting a session with session name "sid" (defined in php.ini for default, see examples below).
When I change the session name to another value (like "foo" for example), everything works fine and the session id is set correctly.
When I change the "foo" in the working example to "sid" to set the session name explicit to that value, the same errors occur.
Thanks for help and best regards,
Kamil
Reproduce code:
---------------
<?
// Error code: Session name is "sid" for default from php.ini.
session_start();
echo 'Session Name: '.session_name().'<br />';
echo 'Session Id: '.session_id().'<br />';
?>
<?
// This code works fine (when changing foo to sid it also does not work).
session_name('foo');
session_start();
echo 'Session Name: '.session_name().'<br />';
echo 'Session Id: '.session_id().'<br />';
?>
Expected result:
----------------
From error code:
Warning: session_start() [function.session-start]: The session id contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in /web/music2deal/htdocs/bla1.php on line 3
Session Name: sid
Session Id:
Warning: Unknown: The session id contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,' in Unknown on line 0
Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
--------
From the working code:
Session Name: foo
Session Id: u4i4o1hekpranqom4m8tu1u074
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 21:00:02 2025 UTC |
Hmm, i see what you mean now, but it works very fine here. The output of the script: <? // This code works fine (when changing foo to sid it also does not work). session_name('sid'); session_start(); echo 'Session Name: '.session_name().'<br />'; echo 'Session Id: '.session_id().'<br />'; ?> shows: Session Name: sid Session Id: 034dafeac0bb2986bda981eb89f6f46d perhaps you have some settings in php.ini, or session_auto_start set to true?