session_start failure

From: Florence HENRY (raslebol_at_duspam.fr)
Date: 03/30/04


Date: Tue, 30 Mar 2004 20:13:14 +0200

Hello,

I've searched about my problem on google before posting, but I didn't find
anything relevant...

I have a problem with session_start. Here is my code :

<html>
        <head>
                <?php session_start();
                        $id = session_id();
                        $_SESSION['color'] = 'green'; ?>
                <title>PHP test</title>
        </head>
        <body>
        this is my ID : <?php echo $id; ?>
        <br />
        these are my data : <?php print_r($_SESSION); ?>
        </body>
</html>

the value printed by "echo $id" or "echo session_id()" is empty!
As I use post or get to transmit the session id, my scripts don't work.

The reason may be in the log. Here are the messages I get when I try to
execute the code above :

[Tue Mar 30 18:12:02 2004] [error] PHP Warning: session_start(): The
session id contains invalid characters, valid characters are only a-z, A-Z
and 0-9 in /home/www/session.php on line 3
[Tue Mar 30 18:12:02 2004] [error] PHP Warning: Unknown(): The session id
contains invalid characters, valid characters are only a-z, A-Z and 0-9 in
Unknown on line 0
[Tue Mar 30 18:12:02 2004] [error] PHP 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

How can the session id contain invalid characters, as it is PHP who decides
it!

I read many times the doc, I do not understand where I'm wrong...

Thanks for any tip.

-- 
Florence HENRY
florence point henry arobasse obspm point fr


Relevant Pages

  • Re: Sessions variables empty
    ... PHP Warning: Unknown(): Failed to write session data. ... PHP Warning: Unknown: The session id contains invalid characters, ... valid characters are only a-z, A-Z and 0-9 in Unknown on line 0 ...
    (comp.lang.php)
  • session id contains invalid characters
    ... contains invalid characters, valid characters are only a-z, A-Z and 0-9 in ... invalid characters, valid characters are only a-z, A-Z and 0-9 in Unknown on ...
    (comp.lang.php)