PHP session not started

superaff1984

Senior Member
Premium Member
Joined
Jun 16, 2010
Messages
992
Reaction score
131
I have a redirect setup and oddly this redirect is working fine in another directory. However, the session does not start. I checked everything before it, everything is right on the page that is linking into our link.php .

See the link.php page below. Does anyone have any clue why the session is not starting? I used var_dump to print out the session data, but it's no where to be found. However as mentioned above I am certain the session data is storing because on the page that links into this link.php file below the session shows all the data.. I can't figure out what is wrong or why the session is not starting on this page?


PHP:
<?php 
session_start();
$key = date("mdy");
$clickid = $_SESSION['clickid'];
$c1 = $_SESSION['c1'];
$s1 = $_SESSION['s1'];
$adp = $_SESSION['adp'];
$flow = $_SESSION['flow'];


if(empty($flow))
{

$redirectUrl = "https://domain/mobile/?clickid=$clickid&c1=$c1&affid=LZCAVXPS&s1=$s1&adp=$adp&utm_source=505505&utm_medium=505505&utm_campaign=ME&flow=check&key=$key";

}elseif($flow == '2'){
    
    $redirectUrl = "https://domain/mobile/?clickid=$clickid&c1=$c1&affid=LZCAVXPS&s1=$s1&adp=$adp&utm_source=505505&utm_medium=505505&utm_campaign=ME&flow=check&key=$key";
}

header("Location: " . $redirectUrl);
exit;

?>
 
Check the session configuration in your php.ini file. Make sure the session settings such as session.save_path, session.cookie_lifetime, and session.gc_maxlifetime are correctly configured.
 
Check the session configuration in your php.ini file. Make sure the session settings such as session.save_path, session.cookie_lifetime, and session.gc_maxlifetime are correctly configured.

I think what it was, was that we were using an older PHP version. I updated our PHP to the latest stable version and it started working.
 
Back
Top