refiking Posted December 1, 2011 Share Posted December 1, 2011 I have a script that was written and tested on another server, but now when I transferred it to the live server, session values are not being passed. I made a couple test pages to check and confirmed that the only issue is the session variables. Here is the test I performed. Please tell me what I'm missing: page1.php <? session_start(); $_SESSION['var1'] = 'testing'; print_r($_SESSION); ?> Returns: Array ( [var1] => testing ) page2.php <? session_start(); print_r($_SESSION); ?> Returns: Array () Link to comment https://forums.phpfreaks.com/topic/252255-session-values-not-passing-to-other-pages/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 1, 2011 Share Posted December 1, 2011 Add the following three lines of code immediately after your first opening <?php tag on both pages, try again, and report any errors - ini_set("display_startup_errors", "1"); ini_set("display_errors", "1"); error_reporting(-1); Link to comment https://forums.phpfreaks.com/topic/252255-session-values-not-passing-to-other-pages/#findComment-1293263 Share on other sites More sharing options...
refiking Posted December 1, 2011 Author Share Posted December 1, 2011 Array ( [var1] => testing ) Warning: Unknown: open(C:\Windows\Temp\sess_akcd20pu86q7mvn2tdfahltja2, O_RDWR) failed: Permission denied (13) in Unknown on line 0 Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (C:\Windows\Temp) in Unknown on line 0 How can I set the session folder to a directory that I create? Link to comment https://forums.phpfreaks.com/topic/252255-session-values-not-passing-to-other-pages/#findComment-1293270 Share on other sites More sharing options...
Eiolon Posted December 2, 2011 Share Posted December 2, 2011 You set the session.save_path in your PHP.INI file. Link to comment https://forums.phpfreaks.com/topic/252255-session-values-not-passing-to-other-pages/#findComment-1293309 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.