Session Variables not working on Unix server, but Working on WAMP localhost

I have a site that was developed using EasyPHP software on a windows computer. To test it on a live server I uploaded it to a server hosted by ipage.com just to make sure that the verification email would send out. When testing it I found that the session variables would not work because it is a Unix machine. What should I do to get the sessions to work? Even my simple redirect script which is:

<?php session_start(); if($_SESSION['loggedin'] == true) { header("Location:main.php"); } else { header("Location:index.php"); } ?>

Gives me nothing but a page with errors about the header. Any ideas about how I can fix this?

Try putting you sessions in " instead of ', I had this problem on a vps and it took me hours to figure it out!

That fixed it :slight_smile:

I tried everything except that lol

Thanks!

Hello, I have the same problem,

but I don’t understand the solution of using “instead of”.

I ll appreciate if you help me with some code for example.

Thanks a lot!

I find out the solution :smiley:

It was so simple: just turn of the “register_globals” in php.ini file

Sponsor our Newsletter | Privacy Policy | Terms of Service