Jump to content

$_SESSION setting variables on one server but not on the other...


Recommended Posts

IIS seems to be fine:OUTPUT:User added...mysql@mysql.commysqlmysql Apache & PHP not so muchOUTPUT:User added... success.php:<?phpsession_start();echo "User added...";echo $_SESSION["email_address"]."<br>";echo $_SESSION["last_name"]."<br>";echo $_SESSION["first_name"]."<br>";?> Why would $_SESSION be output on one server but not on the other. I already tried setting the permissions of the sessions save path to 777 to no avail.... I have to admit I am most confused. The code does run on both servers without any serious breaks but on my rackspace.com cloud I dont get the $_session coming out. Does anyone know why this might be?

Edited by sepoto
Link to post
Share on other sites

I don't see any problems with the code you posted. Check the error settings, make sure you're showing all error messages or writing them to a log file. PHP will show errors if there are problems starting a session.

Link to post
Share on other sites

It needed to be more like this: session_start();$email_address = $postFields["email_address"];$_SESSION["email_address"] = $email_address;$_SESSION["last_name"] = $postFields["last_name"];$_SESSION["first_name"] = $postFields["first_name"];session_write_close(); The call to session_write_close() brought the code online.

Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...