Post by Joe1234 » Mon Mar 11, 2024 8:40 am

I have the following in my htaccess which is causing logout not to happen properly.

Code: Select all

<IfModule mod_expires.c>

	## Turn on the module.
	ExpiresActive on
	## Set the default expiry times.
	ExpiresDefault "access plus 2 days"
	ExpiresByType image/webp "access plus 6 month"
	ExpiresByType image/jpg "access plus 6 month"
	ExpiresByType image/svg+xml "access 6 month"
	ExpiresByType image/gif "access plus 6 month"
	ExpiresByType image/jpeg "access plus 6 month"
	ExpiresByType image/png "access plus 6 month"
	ExpiresByType text/css "access plus 6 month"
	ExpiresByType text/javascript "access plus 6 month"
	ExpiresByType application/javascript "access plus 6 month"
	ExpiresByType application/x-shockwave-flash "access plus 6 month"
	ExpiresByType image/ico "access plus 6 month"
	ExpiresByType image/x-icon "access plus 6 month"
	#ExpiresByType text/html "access plus 5 days"

</IfModule>
Is there something I can add that will fixt this issue with logout? Also, will this affect checkout/success?
Last edited by Joe1234 on Tue Apr 02, 2024 1:12 pm, edited 2 times in total.

v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by JNeuhoff » Mon Mar 11, 2024 9:41 am

Come on, by now you should know that if you really want some help here, you have to provide some more details. The checkout in OC 3.0.3.9 works just fine.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Joe1234 » Mon Mar 11, 2024 9:54 am

Sorry, I see I didn't explain it properly. If I remove that from htaccess logout works fine, if it stays, I stay logged in (I assume until things expire). It initially shows that I'm logged out, but if I refresh I see that I'm still logged in. That's everything I have to provide with this issue. If there is something specific beyond that that you need to know you are going to have to tell me because I don't know what else may be involved. I don't have any extensions that interact with logout, and I don't have any cache extensions. Thanks.

v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by ravikumar22 » Mon Mar 11, 2024 4:53 pm

Joe1234 wrote:
Mon Mar 11, 2024 8:40 am
I have the following in my htaccess which is causing logout not to happen properly.

Code: Select all

<IfModule mod_expires.c>

	## Turn on the module.
	ExpiresActive on
	## Set the default expiry times.
	ExpiresDefault "access plus 2 days"
	ExpiresByType image/webp "access plus 6 month"
	ExpiresByType image/jpg "access plus 6 month"
	ExpiresByType image/svg+xml "access 6 month"
	ExpiresByType image/gif "access plus 6 month"
	ExpiresByType image/jpeg "access plus 6 month"
	ExpiresByType image/png "access plus 6 month"
	ExpiresByType text/css "access plus 6 month"
	ExpiresByType text/javascript "access plus 6 month"
	ExpiresByType application/javascript "access plus 6 month"
	ExpiresByType application/x-shockwave-flash "access plus 6 month"
	ExpiresByType image/ico "access plus 6 month"
	ExpiresByType image/x-icon "access plus 6 month"
	#ExpiresByType text/html "access plus 5 days"

</IfModule>
Is there something I can add that will fixt this issue with logout? Also, will this affect checkout/success?
Hi,
try this forum viewtopic.php?t=201745
and let me know if you still facing any issue.

Image
:) :D :( :o OpenCart Support | Please email at: devinlabsolutions@gmail.com , info@devinlabs.com :drunk: :laugh: :)


User avatar
New member

Posts

Joined
Sun Apr 12, 2015 6:33 am

Post by ADD Creative » Tue Mar 12, 2024 12:22 am

OpenCart 3.0.3.9 does not set cache control headers so 'ExpiresDefault "access plus 2 days"' will cause your web browser to cache all sort or responses it shouldn't.

This has been fixed in the hopefully soon to be released next 3.0.x.x version on GitHub. the fix is https://github.com/opencart/opencart/pull/13599.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Joe1234 » Wed Mar 13, 2024 12:37 am

Thanks but before I implement that, I'm no expert, but looking at it doesn't that simply illuminates all caching, instead of just logout/checkout? I can just do that in htaccess no? And by doing that, doesn't that illuminate the caching site wide? Meaning the images and regular pages wont be cached as well?

v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by ADD Creative » Wed Mar 13, 2024 5:41 pm

It doesn't eliminate all caching, just the pages generated by PHP. All images and style sheets will still be cached.

You could add the headers into htaccess, but you would need to only do this to the PHP generated responses.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Joe1234 » Mon Mar 18, 2024 8:09 pm

Seems to work great, thanks.

v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by Joe1234 » Tue Apr 02, 2024 1:11 pm

Looks like I celebrated too quickly. It isn't working consistently. Any other solution?

v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by ADD Creative » Tue Apr 02, 2024 7:25 pm

You would need to look at the response headers in your web browser's developer tool. This should tell you if it's a browser caching issue or not.

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by Joe1234 » Tue Apr 02, 2024 11:28 pm

Seems that was it. I forgot to delete that default and html cache control in the htaccess since put in that code. Thanks.

v3.0.4.0 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by paulfeakins » Wed Apr 03, 2024 7:00 pm

Joe1234 wrote:
Tue Apr 02, 2024 11:28 pm
Seems that was it. I forgot to delete that default and html cache control in the htaccess since put in that code. Thanks.
Great! So please add [SOLVED] to the start of this topic title.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 18 guests