LLMS_Session::set_cookie()

Set the cookie


Return Return

(boolean)


Top ↑

Source Source

File: includes/class.llms.session.php

298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
protected function set_cookie() {
 
    $hash_str = sprintf( '%1$s|%2$s', $this->get_id(), $this->expires );
    $hash     = hash_hmac( 'md5', $hash_str, wp_hash( $hash_str ) );
    $value    = sprintf( '%1$s||%2$d||%3$d||%4$s', $this->get_id(), $this->expires, $this->expiring, $hash );
 
    // There's no cookie set or the existing cookie needs to be updated.
    if ( ! isset( $_COOKIE[ $this->cookie ] ) || $_COOKIE[ $this->cookie ] !== $value ) {
 
        return llms_setcookie( $this->cookie, $value, $this->expires, COOKIEPATH ? COOKIEPATH : '/', COOKIE_DOMAIN, $this->use_secure_cookie(), true );
 
    }
 
    return false;
 
}


Top ↑

Changelog Changelog

Changelog
Version Description
4.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.