Click to See Complete Forum and Search --> : Question : Sessions Win98 apache module


Anon
02-12-2001, 06:01 AM
Hi all

I am trying to use sessions on win98 with Apache and PHP4.04 as Apache module.

have added:
LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php4
to httpd.conf

have changed php.ini to save files in directory.

phpinfo() says SAPI is apache, session files appear in directory, session variables appear to be set when viewed on page session started on but when I request new page the variables seem to be empty.

what don't I understand? What am I missing?

Thanks for your help.

Angus Fraser

Anon
02-12-2001, 03:02 PM
are you calling session_start() at the top of every page, before you try to access your session vars?

starting page should be:
<?php
session_start();
session_register("myVar");

$myVar = "it worked!";
?>

other page should be:
<?php
session_start(); //need to start session before accessing it
print $myVar; //should print "it worked!"
?>

try that.
p.