bbram Posted December 25, 2020 Share Posted December 25, 2020 I am finally making the upgrade from PHP 5.3 to PHP 7.3. When converting over the code I noticed that session some sessions are not being processed. My test code for this is below: session_start(); include ("../includes/connect.inc"); echo "hiiiiiiii: ".$currentDate; echo "Here: ".$_SESSION['user']; if (isset($_SESSION['user'])) { $user = $_SESSION['user']; $currentDate = date("Y/m/d"); } else { echo "Session not started: "; } My include is listed below: $link = mysqli_connect('localhost', 'root', ''); if (!$link) { die('Could not connect: ' . mysql_error("Connection error message")); } mysqli_select_db($link, 'dbname') or die (mysqli_error($link)); date_default_timezone_set('America/Chicago'); define ("TZ_CORRECTION", 43200); $bkcolor = "#FFFFFF"; $currentDate = (Date("Y-m-d")); I am not getting the message "Session not started or the current date from the include". If it matters I am using WAMP as my testing server Any help is greatly appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/311924-session-variables-are-not-being-read/ Share on other sites More sharing options...
requinix Posted December 25, 2020 Share Posted December 25, 2020 Make sure you have your php.ini set up for development with these settings (restart WAMP if you change them): error_reporting = -1 display_errors = on Then look for error messages. Quote Link to comment https://forums.phpfreaks.com/topic/311924-session-variables-are-not-being-read/#findComment-1583404 Share on other sites More sharing options...
Solution mac_gyver Posted December 26, 2020 Solution Share Posted December 26, 2020 are you using full <?php opening tags, per the problem in one of your previous threads? https://forums.phpfreaks.com/topic/311034-includes-not-being-displayed-on-page how about the other improvements made in that thread? you seem to have gone backwards. Quote Link to comment https://forums.phpfreaks.com/topic/311924-session-variables-are-not-being-read/#findComment-1583424 Share on other sites More sharing options...
bbram Posted January 15, 2021 Author Share Posted January 15, 2021 you are correct...I totally forgot that and have fixed my code to have that and to display error messages...thank you for the help! Quote Link to comment https://forums.phpfreaks.com/topic/311924-session-variables-are-not-being-read/#findComment-1583796 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.