awcode Posted March 2, 2015 Share Posted March 2, 2015 I have a module that needs to display a popup once and then not display again for 24 hours. Normally doing this with a cookie is a trivial task, however the prestashop cache is causing issues. I am using context->cookie->__set and context->cookie->key which are working ok. But the big problem is as follows:- 1) Set cookie and echo value in comment as a test - nothing comes up. 2) Clear cache - test value shows. 3) Open different browser - test value from previous session in other browser is shown. Clearly the cookie code is working and running, but only runs once and is then stored in cache and retrieved for all subsequent users. I need this code to actually run on each request so it can determine the cookie value relative to the current active user. This is currently running in hookFooter if it makes a difference. Is there any way that I can either disable cache for this specific hook or module or otherwise force the code to actually run? Link to comment Share on other sites More sharing options...
Dh42 Posted March 2, 2015 Share Posted March 2, 2015 Are you caching the template file for the module? That sounds like the issue. Link to comment Share on other sites More sharing options...
awcode Posted March 2, 2015 Author Share Posted March 2, 2015 Where is that set then? Link to comment Share on other sites More sharing options...
Dh42 Posted March 2, 2015 Share Posted March 2, 2015 It would be coded in the module. Where the php outputs the template. If you are putting the variable in the module that way, you are doing it wrong too. You need to use js really and check a value in the cookie set on the users computer, not against a value in a template file. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now