Jump to content

session id, Changes when running external scripts


koolaid

Recommended Posts

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'];
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.