Jump to content

How to delete cookies customers?


Recommended Posts

hello,

The problem is for my visitors, it is essential that cookies be given a 0 ... because it is unable to log all the login page loads loop ...

I'm not their little say delete cookies manually.

I would really help ...

Link to comment
Share on other sites

Just visit Administrator -> Preferences  and set Frontend Cookies time to 1 hour ( Unfortunately, min value is 1 hour ).

After 1 hour, your customers cookies will be deleted. Is it ok ? 

If you want to show a popup / notification on your Prestashop Store by using cookies, you should try to use Amazing notice Box and Bar module

Edited by PrestaSOO (see edit history)
Link to comment
Share on other sites

hello,

Thank you for your answers!

Before yesterday I set about an hour, but the problem was still persisting this morning.

I think I solved by giving the address in SEO & URL 'SSL'

But it would be really nice to change the name of the domain to solved all the problems.

On this forum we find solutions or it takes to remove the url in SSL. whereas if I do it, my clients can not connect more.


Also I met another problem with cookies also:

When I activate the CDN CNAME with OVH, it create an error with the AJAX cart! Error that is not when the CDN is to disable or incognito (No cookies)

It may not be the link, but I did try some knowledge.

 

74a693130c.png

Link to comment
Share on other sites

  • 1 year later...

The problem is the following:

 

The customer is logging in, and no categories / products can be seen (blank screen, only the header and background displayed). It helps, if the customer deletes the cookies from his browser.

I had this experience with many customers. Some of them executed the deletion of the cookies, and everything went fine after that.

 

Interesting, that without logging in the categories and products are visible

 

Prestashop version: 1.6.1.1

 

Is there any solution to handle an automatic cookie deletion in the first time the customer visits the webshop?

Link to comment
Share on other sites

  • 5 months later...
  • 2 months later...

I solved (for now) the same problem overriding the method __construct (classes/Cookie.php) changing the commented lines
 
override/classes/Cookie.php

class Cookie extends CookieCore
{
    public function __construct($name, $path = '', $expire = null, $shared_urls = null, $standalone = false, $secure = false)
    {
        $this->_content = array();
        $this->_standalone = $standalone;
        $this->_expire = is_null($expire) ? time() + 1728000 : (int)$expire;
        $this->_path = trim(($this->_standalone ? '' : Context::getContext()->shop->physical_uri).$path, '/\\').'/';
        if ($this->_path{0} != '/') {
            $this->_path = '/'.$this->_path;
        }
        $this->_path = rawurlencode($this->_path);
        $this->_path = str_replace('%2F', '/', $this->_path);
        $this->_path = str_replace('%7E', '~', $this->_path);
        $this->_domain = $this->getDomain($shared_urls);

        //remove www from url > example: .domain.com
        $this->_domain =str_replace('www','', $this->_domain);

        //Change cookie name "PrestaShop" > "MyCookieName"
        $this->_name = 'MyCookieName-'.md5(($this->_standalone ? '' : _PS_VERSION_).$name.$this->_domain);

        $this->_allow_writing = true;
        $this->_salt = $this->_standalone ? str_pad('', 8, md5('ps'.__FILE__)) : _COOKIE_IV_;
        if ($this->_standalone) {
            $this->_cipherTool = new Blowfish(str_pad('', 56, md5('ps'.__FILE__)), str_pad('', 56, md5('iv'.__FILE__)));
        } elseif (!Configuration::get('PS_CIPHER_ALGORITHM') || !defined('_RIJNDAEL_KEY_')) {
            $this->_cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
        } else {
            $this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
        }
        $this->_secure = (bool)$secure;

        $this->update();
    }
}

I hope that helps!

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

×
×
  • Create New...