0

I have website built on Codeigniter and on product page which has loads of images etc so I setup htaccess caching as following:

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

<IfModule mod_deflate.c>

However issue is when customer go through the check out process and place order I am using codeigniter sess_destroy to destroy use session. However when I go back to product URL it shows there is items in cart. When I click to check out again. I have nothing in my cart which means codeigniter did destroy the session.

How to resolve this? Please help

Zee
  • 225
  • 1
  • 11
  • this is a caching problem - if you reload this site, you'll see there is nothing, take a look here https://stackoverflow.com/questions/49547/how-to-control-web-page-caching-across-all-browsers – sintakonte Apr 09 '18 at 10:26
  • @sintakonte When I refresh it still shows there is item in cart. But when I go to my cart there is nothing. – Zee Apr 09 '18 at 12:00
  • It's still a browser (caching) problem. A forced refresh will clear it where a "simple" refresh may not. Unfortunately you cannot stop the user from using the back button. – DFriend Apr 09 '18 at 12:20
  • There is very little you can do. If the user has used the "back" button of their browser, you can't do much, you could however write a little javascript which will update the page accordingly depending on what needs to be done. – killstreet Apr 10 '18 at 09:27

0 Answers0