Re: Sessions not working. Used to work fine.



Nik Coughlin wrote:
Steve wrote:
"Nik Coughlin" <nrkn.com@xxxxxxxxx> wrote in message
news:es2o3p$550$1@xxxxxxxxxxx
Sessions have unexpectedly stopped working on a client's webserver.

PHP Version 4.4.1 running under IIS. When moving from page to page
the session information is lost.

It used to work fine, and the same code works on other machines.
AFAIK no-one has been messing with the box, but it's possible. I've
asked them to try and find out if anyone has changed anything.

The second one has nothing that helps me determine the cause of my problem either.

A minimal test case:

sessionTest1.php:
<?php
session_start();
$_SESSION[ 'test' ] = "Testing";
echo "Test = " . $_SESSION[ 'test' ] . "<br>";
echo '<a href="sessionTest2.php?' . htmlspecialchars(SID) . '">Test Page 2</a>';
?>

sessionTest2.php:
<?php
session_start();
echo "Test = " . $_SESSION[ 'test' ] . "<br>";
echo '<a href="sessionTest1.php">Test Page 1</a>';
?>

You can see what happens here:

http://www.masterpiece.co.nz/sessionTest1.php



Just taking a stab in the dark here: Make sure that your session directory (the directory that PHP store session information) exists.
If you don't know where the directory is see php.ini file

Also take a look at any error log. I don't know about IIS, but when I use apache, I can specify to PHP to send error message to Apache's error log.

Hendri
.



Relevant Pages

  • Re: cant send mail using mail()
    ... the first function i tried is the ... the apache error log said that the parameters are uninitialised. ... Though in the php manual is states the 4th ... Professional have IIS. ...
    (comp.lang.php)
  • Re: IIS, ASP & PHP - is it possible?
    ... IIS is perfectly able to run both ASP and PHP on the same server at the ...
    (microsoft.public.inetserver.iis)
  • Re: php form and ssi
    ... definition any site using phpoi will also be using php. ... SSI is one such simple technology that can be used ... One of the sites did not use any high level languages before. ... Pardon me for being a bit provocative about IIS. ...
    (comp.lang.php)
  • Re: Apache vs IIS
    ... Windows Server not on my Linux Server so there for I would chose IIS. ... Not that Apache is bad but ASP.NET is far easier and faster to create good web forms in. ... You can run asp on Apache server, and you can do that even on an Apache running on a Linux server. ... PHP on a IIS server is rather easy to run once you install PHP on a PC but if you only use PHP why not use Apache for Windows. ...
    (alt.php)
  • Re: cannot pass query string (GET) vars
    ... but for some reason all my PHP scripts now hang when I try ... or IIS ... similar script in ASP and it worked just fine, ... Another post about the error that Firefox ...
    (comp.lang.php)