Page 1 of 1

session_start();

Posted: Fri Mar 12, 2004 4:10 pm
by npodges
i'm having problems using session_start(). ultimately, i want to make a login session, but even using simpler code from the php documentation, i get errors.

Code: Select all

<?php
// page1.php

session_start();

echo 'Welcome to page #1';

$_SESSION&#1111;'favcolor'] = 'green';
$_SESSION&#1111;'animal']  = 'cat';
$_SESSION&#1111;'time']    = time();

// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';

// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>
http://68.41.89.22/retard.php <- the page with errors
http://68.41.89.22/test.php <- my phpinfo()
thanks.
-nick podges

Posted: Fri Mar 12, 2004 4:13 pm
by andre_c
You need to set the php.ini file to
session.save_path = C:\PHP\sessiondata

instead of
/tmp

hmm

Posted: Fri Mar 12, 2004 4:21 pm
by npodges
well, i've got php installed into c:/php-4.3.4-Win32.
there's no sessiondata folder there. should there be?
-nick podges

Posted: Fri Mar 12, 2004 4:23 pm
by andre_c
actually you can name it whatever you want, but make sure if it's not there, create it.
You might also have to restart your web server (not sure)