HI,
it would nice to have “session” as an option for expiration period.
I’ve done this by doing the following:
in File cookie-notice.php i’ve changed the code at line 150+ to
$this->times = array(
'session' => array( __( 'session', 'cookie-notice' ), 0 ),
'day' => array( __( '1 day', 'cookie-notice' ), 86400 ),
'week' => array( __( '1 week', 'cookie-notice' ), 604800 ),
'month' => array( __( '1 month', 'cookie-notice' ), 2592000 ),
'3months' => array( __( '3 months', 'cookie-notice' ), 7862400 ),
'6months' => array( __( '6 months', 'cookie-notice' ), 15811200 ),
'year' => array( __( '1 year', 'cookie-notice' ), 31536000 ),
'infinity' => array( __( 'infinity', 'cookie-notice' ), PHP_INT_MAX )
);
The new thing is here the “Session”-Option.
And in front.js i changed line 17 to:
document.cookie = cnArgs.cookieName + '=' + cookie_value + (parseInt( cnArgs.cookieTime ) > 0 ? ';expires=' + cnLater.toGMTString() : '')+ ';' + ( cnArgs.cookieDomain !== undefined && cnArgs.cookieDomain !== '' ? 'domain=' + cnArgs.cookieDomain + ';' : '' ) + ( cnArgs.cookiePath !== undefined && cnArgs.cookiePath !== '' ? 'path=' + cnArgs.cookiePath + ';' : '' );
It’s working for me, but it were nice to have it in an official release, so it’s save for Updates.
Regards,
Christian Hitzmann
-
This reply was modified 7 years, 9 months ago by agrajag111.
-
This reply was modified 7 years, 9 months ago by agrajag111.