Jump to content

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

Certainly that would solve my problem.

 

What has happened as I had this site dumped into my hands.

 

I don't really want to have to repair someone elses failures.

 

they have unwisely used sessions everywhere making the above suggestion such a pain and time consumer.

Link to comment
https://forums.phpfreaks.com/topic/64267-session-troubles/#findComment-320387
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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.