Jump to content

Session Troubles


PhpTim

Recommended Posts

Hi Everyone,

 

Basically I have moved a website from a Linux based system Running PHP to a Windows based sytem with IIS 6 with PHP 5 isapi plugin. (Not my decision) Both version 5.2.3

 

My troubles lay with Sessions.

 

session_start();

 

// Session not previously set

 

if( $_SESSION['Sname'] != '' ){

      //Condition

}

 

The above statement works on the linux box but fails on the windows box.

 

with the error being:

 

Notice: Undefined index: Sname

 

and every session variable after that receives the error

 

Notice: Undefined variable

 

on the windows box I have the right permissions I believe set for the session files.

 

I can even visually confirm the sessions files are being created.

 

Any help would be appreciated as trying to fix this website would take too long (not written by myself trust me)

 

Thanks in Advance

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/64267-session-troubles/
Share on other sites

I don't think there is a way to fix your problem without making SOME sort of change to all those lines. If you have a program like Dreamweaver, you can search for "if( $_SESSION['Sname'] != '' )" and do a replace all with "if(isset($_SESSION['Sname']))". Sit back and watch it happen.

 

I don't know the differences between windows and linux running php. One of the causes might be that error outputting was turned off completely on the linux box, but the error really was occurring. If you don't plan on doing any more debugging, you can try turning it off on the windows box, assuming the code actually works when it outputs the errors.

Link to comment
https://forums.phpfreaks.com/topic/64267-session-troubles/#findComment-320398
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.