0
문제 리디렉션 이월 나던.PHP 세션 변수
facebook.php (세션 변수 생성 및 저장)
버튼을 available.php하도록 지시 -> searching.php
내가 사용 헤더 리디렉션. 그래서 $ _SESSION [ 'seshfbId'] available.php에 에코하지만
코드
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을 searching.php하지
<?php
session_start(); // start up your PHP session!
echo $_SESSION['seshfbId'];
?>
편집 : vardump 후 검색 페이지에서 seshId 및 seshToken을 발견했습니다. 그러나 그것을 만드는 데 사용 된 코드는 tac.php에 있습니다. 나는 느낌 tac.php 코드는 세션 변수 이전
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;
'var_dump ($ _ SESSION)'에 이전에 설정 한 변수가 포함되어 있습니까? 'session_id()'의 경우, 모든 페이지에서 같은 세션 ID를 얻나요? – Tchoupi
Firebug 또는 Chrome의 개발자 도구를 사용하여 요청이 진행되는 동안 요청을 볼 수 있습니다. 리다이렉트 체인의 마지막 페이지가 동일한'PHPSESSID' 쿠키를 얻는 지 확인하십시오. – Halcyon
이 페이지를 참조하십시오. 하위 도메인 간 세션을 통과시키고 싶습니다. http://stackoverflow.com/questions/795414/why-cant-i-pass-user-sessions-between-subdomains and http://stackoverflow.com/questions/ 이 때문에 644920/수 - PHP가 세션 - 투 - 이월 - 투 - 하위 도메인 –