offdarip Posted January 31, 2011 Share Posted January 31, 2011 Most of my website is written in php4. My hosting server has support for both 4 and 5 just by changing file extension. .php which is the default supports 4, .php5 of course supports 5. The problem I am having is that the pages with the .php5 extensions are not recognizing session variables. Is there something I should be doing differently in 5 for my session variables? For example a variable request like this returns 0 print $_SESSION['FULLNAME']; Please Help!! Thank you in advance? Quote Link to comment https://forums.phpfreaks.com/topic/226195-problems-with-session-variables-on-php5-pages/ Share on other sites More sharing options...
trq Posted January 31, 2011 Share Posted January 31, 2011 Are you switching between php 5 and php 4 ? Chances are these store the session cookies in a different location. Quote Link to comment https://forums.phpfreaks.com/topic/226195-problems-with-session-variables-on-php5-pages/#findComment-1167681 Share on other sites More sharing options...
offdarip Posted January 31, 2011 Author Share Posted January 31, 2011 Yes i am, my log in scripts and most of my web site is in php4 and just those few scripts and in 5 Quote Link to comment https://forums.phpfreaks.com/topic/226195-problems-with-session-variables-on-php5-pages/#findComment-1167684 Share on other sites More sharing options...
trq Posted January 31, 2011 Share Posted January 31, 2011 I would have a look at session_get_cookie_params firstly in both php 4 and then again in php5 to see if this is the actual problem. If your path is different in each, you might be able to fix it by simply setting them both to use the same path. You would do this using ini_set or better yet, use a .htaccess directive or edit your php.ini files if you have access to them. Quote Link to comment https://forums.phpfreaks.com/topic/226195-problems-with-session-variables-on-php5-pages/#findComment-1167687 Share on other sites More sharing options...
offdarip Posted January 31, 2011 Author Share Posted January 31, 2011 Thanks I will check that out... and if they are in different places can they be changed to the same? Quote Link to comment https://forums.phpfreaks.com/topic/226195-problems-with-session-variables-on-php5-pages/#findComment-1167690 Share on other sites More sharing options...
trq Posted January 31, 2011 Share Posted January 31, 2011 Thanks I will check that out... and if they are in different places can they be changed to the same? Um, that's what I just said to try. Quote Link to comment https://forums.phpfreaks.com/topic/226195-problems-with-session-variables-on-php5-pages/#findComment-1167696 Share on other sites More sharing options...
offdarip Posted January 31, 2011 Author Share Posted January 31, 2011 Thank You! You are a lifesaver! That worked like a charm.. I've been trying to get that right for soooo long.. Thank you again. Quote Link to comment https://forums.phpfreaks.com/topic/226195-problems-with-session-variables-on-php5-pages/#findComment-1167703 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.