[-] FO : cookie lifetime is now set with the front end lifetime value instead of the BO value #PSCFV-5668
This commit is contained in:
@@ -109,21 +109,24 @@ Context::getContext()->country = $defaultCountry;
|
|||||||
@date_default_timezone_set(Configuration::get('PS_TIMEZONE'));
|
@date_default_timezone_set(Configuration::get('PS_TIMEZONE'));
|
||||||
|
|
||||||
/* Instantiate cookie */
|
/* Instantiate cookie */
|
||||||
$cookieLifetime = (time() + (((int)Configuration::get('PS_COOKIE_LIFETIME_BO') > 0 ? (int)Configuration::get('PS_COOKIE_LIFETIME_BO') : 1)* 3600));
|
|
||||||
|
|
||||||
|
$cookie_lifetime = (int)(defined('_PS_ADMIN_DIR_') ? Configuration::get('PS_COOKIE_LIFETIME_BO') : Configuration::get('PS_COOKIE_LIFETIME_FO'));
|
||||||
|
$cookie_lifetime = time() + (max($cookie_lifetime, 1) * 3600);
|
||||||
|
|
||||||
if (defined('_PS_ADMIN_DIR_'))
|
if (defined('_PS_ADMIN_DIR_'))
|
||||||
$cookie = new Cookie('psAdmin', '', $cookieLifetime);
|
$cookie = new Cookie('psAdmin', '', $cookie_lifetime);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Context::getContext()->shop->getGroup()->share_order)
|
if (Context::getContext()->shop->getGroup()->share_order)
|
||||||
$cookie = new Cookie('ps-sg'.Context::getContext()->shop->getGroup()->id, '', $cookieLifetime, Context::getContext()->shop->getUrlsSharedCart());
|
$cookie = new Cookie('ps-sg'.Context::getContext()->shop->getGroup()->id, '', $cookie_lifetime, Context::getContext()->shop->getUrlsSharedCart());
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$domains = null;
|
$domains = null;
|
||||||
if(Context::getContext()->shop->domain != Context::getContext()->shop->domain_ssl)
|
if(Context::getContext()->shop->domain != Context::getContext()->shop->domain_ssl)
|
||||||
$domains = array(Context::getContext()->shop->domain_ssl, Context::getContext()->shop->domain);
|
$domains = array(Context::getContext()->shop->domain_ssl, Context::getContext()->shop->domain);
|
||||||
|
|
||||||
$cookie = new Cookie('ps-s'.Context::getContext()->shop->id, '', $cookieLifetime, $domains);
|
$cookie = new Cookie('ps-s'.Context::getContext()->shop->id, '', $cookie_lifetime, $domains);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user