koolaid Posted January 19, 2009 Share Posted January 19, 2009 I have a very simple session. When i run an external script the session id changes. Has anyone else had this problem? I need to run the script without refreshing the page. Is there a way to have my external script access my session data? if (session_id()) { echo "session has started."; $_SESSION['sessid'] = session_id(); echo $_SESSION['sessid']; } else { $time = time(); $date = $today = date("Ymd"); $id = $time + $date; session_id($id); $_SESSION['sessid'] = session_id(); echo $_SESSION['sessid']; } external script <?php session_start(); echo session_id(); echo $_SESSION['sessid']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/141459-session-id-changes-when-running-external-scripts/ Share on other sites More sharing options...
corbin Posted January 19, 2009 Share Posted January 19, 2009 Are they on the same domain name? Quote Link to comment https://forums.phpfreaks.com/topic/141459-session-id-changes-when-running-external-scripts/#findComment-740454 Share on other sites More sharing options...
koolaid Posted January 19, 2009 Author Share Posted January 19, 2009 Yup, same domain. The script i run just doesn't preserve any session data. Quote Link to comment https://forums.phpfreaks.com/topic/141459-session-id-changes-when-running-external-scripts/#findComment-740467 Share on other sites More sharing options...
koolaid Posted January 20, 2009 Author Share Posted January 20, 2009 bump Quote Link to comment https://forums.phpfreaks.com/topic/141459-session-id-changes-when-running-external-scripts/#findComment-740906 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.