[SOLVED] $_SESSION doesn't work

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
whiteadi
Forum Newbie
Posts: 11
Joined: Fri Mar 05, 2004 7:12 am
Location: Timisoara
Contact:

$_SESSION doesn't work

Post 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
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

upgrade

Post 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.
whiteadi
Forum Newbie
Posts: 11
Joined: Fri Mar 05, 2004 7:12 am
Location: Timisoara
Contact:

found it

Post by whiteadi »

4.1.2 has a bug related to $_SESSION,

I put other version and works now.
Post Reply