Jump to content

Auth Session Expires


HenryC

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/239063-auth-session-expires/
Share on other sites

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.