Dailymotion.php
protected function storeSession(array $session = array())
    {
        if (headers_sent())
        {
            if (php_sapi_name() !== 'cli')
            {
                error_log('Could not set session in cookie: headers already sent.');
            }
            return $this;
        }
        $cookieName = sprintf(self::SESSION_COOKIE, $this->grantInfo['key']);
        if (!empty($session))
        {
            $value   = '"' . http_build_query($session, null, '&') . '"';
            $expires = time() + $this->cookieLifeTime;
        }
        else
        {
            $cookieValue = filter_input(INPUT_COOKIE, $cookieName);
            if (empty($cookieValue))
            {
                // No need to remove an unexisting cookie
                return $this;
            }
            $value   = 'deleted';
            $expires = time() - 3600;
        }
        setcookie($cookieName, $value, $expires, '/', $this->cookieDomain);
        return $this;
    }
protected function storeSession(array $session = array())
    {
        if (headers_sent())
        {
            if (php_sapi_name() !== 'cli')
            {
                error_log('Could not set session in cookie: headers already sent.');
            }
            return $this;
        }
        $cookieName = sprintf(self::SESSION_COOKIE, $this->grantInfo['key']);
        if (!empty($session))
        {
            $value   = '"' . http_build_query($session, null, '&') . '"';
            $expires = time() + $this->cookieLifeTime;
        }
        else
        {
            $cookieValue = filter_input(INPUT_COOKIE, $cookieName);
            if (empty($cookieValue))
            {
                // No need to remove an unexisting cookie
                return $this;
            }
            $value   = 'deleted';
            $expires = time() - 3600;
        }
        setcookie($cookieName, $value, $expires, '/', $this->cookieDomain);
        return $this;
    }
protected function storeSession ( array $ session = array ( ) ) { if ( headers_sent ( ) ) { if ( php_sapi_name ( ) !== 'cli' ) { error_log ( 'Could not set session in cookie: headers already sent.' ) ; } return $ this ; } $ cookieName = sprintf ( self :: SESSION_COOKIE , $ this -> grantInfo [ 'key' ] ) ; if ( ! empty ( $ session ) ) { $ value = '"' . http_build_query ( $ session , null , '&' ) . '"' ; $ expires = time ( ) + $ this -> cookieLifeTime ; } else { $ cookieValue = filter_input ( INPUT_COOKIE , $ cookieName ) ; if ( empty ( $ cookieValue ) ) { // No need to remove an unexisting cookie return $ this ; } $ value = 'deleted' ; $ expires = time ( ) - 3600 ; } setcookie ( $ cookieName , $ value , $ expires , '/' , $ this -> cookieDomain ) ; return $ this ; }
Store the given session to the session store.
Default storage is cookie, subclass can implement another storage type if needed.
Information stored in the session are useless without the API secret. Storing these information on the client
should thus be safe as long as the API secret is kept... secret.

@param array $session Session to store, if nothing is passed, the current session is removed from the session store.
@return Dailymotion `$this`
Store the given session to the session store . Default storage is cookie subclass can implement another storage type if needed . Information stored in the session are useless without the API secret . Storing these information on the client should thus be safe as long as the API secret is kept ... secret .