Page 1 of 1

$_SESSION doesn't work

Posted: Tue Sep 28, 2004 2:15 am
by whiteadi
Hi,

first time it is happening this to me;

so I installed apache and php 4.1.2 , I put the path to session files and

when I put something in $_SESSION the file is created but is empty.

If I try to put with session_register() or with $HTTP_SESSION_VARS

it works. Why? This is a problem because it is and because I have to

change a site which of course is using $_SESSION, as it should.

Thanks,
whiteadi

upgrade

Posted: Tue Sep 28, 2004 2:43 am
by phpScott
unless you have a specific reason to use version 4.1.2 you should upgrade your version to the latest 4.x.x version or even to the latest 5.x.x version.

I'm not sure about the version you are using but usually you have to start the session

Code: Select all

<?php
session_start();
// Use $HTTP_SESSION_VARS with PHP 4.0.6 or less
if (!isset($_SESSION['count'])) {
   $_SESSION['count'] = 0;
} else {
   $_SESSION['count']++;
}
?>
ex. form manual http://uk2.php.net/session

to use the sessions.

try it and see what happens.

found it

Posted: Tue Sep 28, 2004 2:45 am
by whiteadi
4.1.2 has a bug related to $_SESSION,

I put other version and works now.