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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.