HenryC Posted June 11, 2011 Share Posted June 11, 2011 Hello all i am using the youtube api system on my website and part of it is to authenticate the user set_include_path('/home/u292976682/public_html/Zend/library'); require_once 'Zend/Loader.php'; // the Zend dir must be in your include_path Zend_Loader::loadClass('Zend_Gdata_YouTube'); $yt = new Zend_Gdata_YouTube(); Zend_Loader::loadClass('Zend_Gdata_AuthSub'); Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); $developerKey = ""; $yt = new Zend_Gdata_YouTube(getAuthSubHttpClient(), $applicationId, $clientId, $developerKey); function getAuthSubRequestUrl() { $next = 'link'; $scope = 'http://gdata.youtube.com'; $secure = false; $session = true; return Zend_Gdata_AuthSub::getAuthSubTokenUri($next, $scope, $secure, $session); } function getAuthSubHttpClient() { if (!isset($_SESSION['sessionToken']) && !isset($_GET['token']) ){ echo "<a href='link' target='_blank'>Link Your Youtube Account</a>"; return; } else if (!isset($_SESSION['sessionToken']) && isset($_GET['token'])) { $_SESSION['sessionToken'] = Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token']); } $httpClient = Zend_Gdata_AuthSub::getHttpClient($_SESSION['sessionToken']); return $httpClient; } Now that works great problem is if the user closes there browser and comes back they need to link there youtube account again, i have read up that the api session will never expire so im not sure why it is, i have even been forced to take session_destroy(); out of my logout page just so it doesnt destroy the sessionToken, anyone know a fix for this? Quote Link to comment https://forums.phpfreaks.com/topic/239063-auth-session-expires/ Share on other sites More sharing options...
HenryC Posted June 12, 2011 Author Share Posted June 12, 2011 anyone ?? Quote Link to comment https://forums.phpfreaks.com/topic/239063-auth-session-expires/#findComment-1228559 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.