1

I apologize for my English, I use google translator

I downloaded a popup module for prestashop, but I need to remove cookies whenever the user logs off from my website.

the module in question has 2 css files, js files 3, 1 and 2 dwt php

reading the various responses on this wonderful site, I realized that you have to add files, but this is what I do not understand how to do and where to put it

so what file do I put here to let you see and have an answer?

how and what files I have to modify or to delete cookies each time a user logs off from my site?

I thank you and the community for your help thanks

Here is a demo of the module http://ps15.iotoscana.com/

  • I really appreciate your kind reply and thanks for your help where should I put this file? this applies only to visitors? – user3343384 Feb 23 '14 at 13:56
  • I really appreciate your kind reply and thanks for your help where should I put this file? this applies only to visitors? I tried to insert it in the php file but cookies are still registered, and if I go to the site I do not see the popup thanks – user3343384 Feb 23 '14 at 14:05

1 Answers1

0

if you want to remove all the cookies , you just need to do the following before you logout the user and redirect it to some other page

if (isset($_SERVER['HTTP_COOKIE'])) {
    $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
    foreach($cookies as $cookie) {
        $parts = explode('=', $cookie);
        $name = trim($parts[0]);
        setcookie($name, '', time()-1000);
        setcookie($name, '', time()-1000, '/');
    }
}

this will invalidate all the cookies you have stored source

Community
  • 1
  • 1