Problem: Session variable doesnt carry over after the redirect.
facebook.php (session variable created, and stored)
button directs to available.php --> searching.php
I'm using header redirect. So $_SESSION['seshfbId'] echos on available.php but not searching.php
Code
facebook.php
<?php
session_start(); // start up your PHP session!
header( 'Location: http://www.redacted.co/chat.php' ) ;
function createSeshVariables($name, $email, $college, $photo, $id)
{
// set the value of the session variable 'name'
$_SESSION['seshName'] = $name;
// set the value of the session variable 'email'
$_SESSION['seshEmail'] = $email;
// set the value of the session variable 'education'
$_SESSION['seshEducation'] = $college;
// set the value of the session variable 'photolink'
$_SESSION['seshPhotolink'] = $photo;
// set the value of the session variable 'photolink'
$_SESSION['seshfbId'] = $id;
}
createSeshVariables($fbName,$fbEmail,$fbCollege,$photolink,$fbId);
?>
available.php
<?php
session_start(); // start up your PHP session!
header( 'Location: http://www.redacted.co/assets/php/searching.php' );
echo $_SESSION['seshfbId'];
//if i comment out header redirect the echo works here.
changeStatusToAvailable($_SESSION['seshfbId']);
?>
searching.php
<?php
session_start(); // start up your PHP session!
echo $_SESSION['seshfbId'];
?>
EDIT: after vardump i have found seshId and seshToken on the searching page. but the code used to create that is on tac.php. I have a feeling tac.php code clashed with session variables earlier
tac.php
$apiObj = new OpenTokSDK(API_Config::API_KEY, API_Config::API_SECRET);
$session = $apiObj->createSession( $_SERVER["REMOTE_ADDR"], array(SessionPropertyConstants::P2P_PREFERENCE=> "enabled") );
$seshId = $session->getSessionId();
$_SESSION['seshId'] = $seshId;
$token = $apiObj->generate_token($seshId, RoleConstants::PUBLISHER, null);
$_SESSION['seshToken'] = $token;