xfrancis Posted December 17, 2015 Share Posted December 17, 2015 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. Quote Link to comment https://forums.phpfreaks.com/topic/299792-php-session-variables-problem/ Share on other sites More sharing options...
requinix Posted December 17, 2015 Share Posted December 17, 2015 Make sure you have error reporting settings appropriate for development: make sure your php.ini has error_reporting = -1 display_errors = onand 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. Quote Link to comment https://forums.phpfreaks.com/topic/299792-php-session-variables-problem/#findComment-1528080 Share on other sites More sharing options...
xfrancis Posted December 17, 2015 Author Share Posted December 17, 2015 Hi requinix! I changed those variables on php.ini but it did not show anything new And about Apache, how do i do to restart it? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/299792-php-session-variables-problem/#findComment-1528081 Share on other sites More sharing options...
requinix Posted December 17, 2015 Share Posted December 17, 2015 I don't have MAMP so try... this? Quote Link to comment https://forums.phpfreaks.com/topic/299792-php-session-variables-problem/#findComment-1528084 Share on other sites More sharing options...
xfrancis Posted December 17, 2015 Author Share Posted December 17, 2015 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). Quote Link to comment https://forums.phpfreaks.com/topic/299792-php-session-variables-problem/#findComment-1528122 Share on other sites More sharing options...
xfrancis Posted December 17, 2015 Author Share Posted December 17, 2015 I've solved it this way, thanks requinix for the help! Quote Link to comment https://forums.phpfreaks.com/topic/299792-php-session-variables-problem/#findComment-1528123 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.