Jump to content

PHP SESSION variables problem


Recommended Posts

Hi everyone! I just completed a website on my local server (MAMP). The problem came when i uploaded to a external server, i dont know why but i cant pass SESSION variables from a page to another. I can make an echo "$_SESSION[user]"; in the same page in which i created the session but if i do it in another page it shows nothing. I have session_start() on the header so its in every page. Hope you can help me, thanks.

Link to comment
Share on other sites

Make sure you have error reporting settings appropriate for development: make sure your php.ini has

error_reporting = -1
display_errors = on
and restart Apache if it does not already. Then try your code and look for error messages.

 

If that doesn't help you find and fix the problem, post your code.

Link to comment
Share on other sites

Hi! I think i've found the problem. In the conn.php i added

Código PHP:
echo session_save_path();  

and when i loaded the page that is on the hosting it shows as save address of session variables C:\MAMP\bin\php\sessions\, or saying it on another way, on my hard drive. Maybe changing that address would solve the problem (i dont know how to do it).

Link to comment
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.