fazzfarrell Posted January 23, 2007 Share Posted January 23, 2007 I have created some sessions, these work on my testing server fine. As soon as I upload to the proper server they stop.[code]<?php require_once('Connections/gmc.php'); ?><?phpini_set("session.save_path", "../SESSIONS");session_start();$Menref = $HTTP_POST_VARS['Ref'];if ($Menref != '') $_SESSION["Menref"] = $Menref; $SubRefr = $HTTP_GET_VARS['SubRef'];if ($SubRefr != '') $_SESSION["SubRefr"] = $SubRefr; $TodayDate = date('l dS \of F Y h:i:s A');$_SESSION['TodayDate'] = $TodayDate;?>[/code]So I tested the server with this[code]<?phpini_set("session.save_path", "../SESSIONS");session_start();if (isset($_SESSION['test'])){ echo "Session found: test is set to ".$_SESSION['test']."<br />\n";} else { $_SESSION['test'] = "some data"; echo "No session data found, so setting the test variable<br />\n"; echo "Click <a href=\"".$_SERVER['PHP_SELF']."\">here</a> to test it out<br />\n";}?>[/code]and it works fine, can any one see where I have gone wrong? Link to comment https://forums.phpfreaks.com/topic/35363-session-problem/ Share on other sites More sharing options...
Orio Posted January 23, 2007 Share Posted January 23, 2007 Try running this:[code]<?php require_once('Connections/gmc.php'); ?><?phpini_set("session.save_path", "../SESSIONS");session_start();if (isset($_POST['Ref']) && !empty($_POST['Ref'])) $_SESSION["Menref"] = $_POST['Ref']; if (isset($_GET['SubRef']) && !empty($_GET['SubRef'])) $_SESSION["SubRefr"] = $_GET['SubRef']; $TodayDate = date('l dS \of F Y h:i:s A');$_SESSION['TodayDate'] = $TodayDate;?>[/code]Orio Link to comment https://forums.phpfreaks.com/topic/35363-session-problem/#findComment-167122 Share on other sites More sharing options...
fazzfarrell Posted January 23, 2007 Author Share Posted January 23, 2007 thanks,Worked with a tweak! [code]<?phpini_set("session.save_path", "../SESSIONS");session_start();// Rob Farrell PageID holds the current ID in a sessionif (isset($_GET['ID']) && !empty($_GET['ID'])) $_SESSION["PageID"] = $_GET['ID']; // Rob Farrell Hold the ref in a session for the three product sets A,B,Cif (isset($_GET['Ref']) && !empty($_GET['Ref'])) $_SESSION["Menref"] = $_GET['Ref']; // Rob Farrell SubRefr hold the sub ref to a product setif (isset($_GET['SubRef']) && !empty($_GET['SubRef'])) $_SESSION["SubRefr"] = $_GET['SubRef']; // Rob Farrell TodayDate holds the current date in a session$TodayDate = date('l dS \of F Y h:i:s A');$_SESSION['TodayDate'] = $TodayDate;?>[/code] Link to comment https://forums.phpfreaks.com/topic/35363-session-problem/#findComment-167143 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.