Bug with Opencart 2.3.0.2 & Journal 3.1.4 with pop up login / shortcode customer name

#1
I have installed Litespeed on my development build, speed works fabulously, but there is some issue.

Opencart 2.3.0.2
Journal 3.1.4
OS - Cent OS 7 & Cpanel
Litespeed server version unknown, using Krystal UK host
LScache version - Latest for 2.3.0.2
PHP 7.2

When you log in via the pop up login the page does not refresh with a customer cached page it loads with a guest cache

only after a few attempts at reloading does it finally show a customer version, and before this happens, if you click the login pop up it renders a version of the whole site in the container box like an iframe.

As well as this, it is, unfortunately, caching the 1st customer who logs in and ultimately generates that cache, I confirmed this by first logging in on chrome. Then i went incognito on Edge and logged in with a completely different user and eventually got the cache of the previous customer
 
Last edited:

serpent_driver

Well-Known Member
#2
When you log in via the pop up login the page does not refresh with a customer cached page it loads with a guest cache
This popup seems to use AJAX and the trick of AJAX is not to refresh the complete page and not to load the complete page again. But LScache engine needs a refresh to check if the login cookie is set to vary the cache. At this moment and to me I can't see any other solution as to use conventional login. Otherwise the function for popup login must be changed to reload the page if user login, but doing it would be in contradiction to AJAX.
 
#3
This was originally a bug with nitro pack too, and they were able to come up with some fix but were very quiet as to what they patched. The result of their fix is that it simply refreshed on page login and it showed the customer cache.

The actual behaviour of the login pop up is not to stay on the same page without refresh, that does not appear to be its intended purpose, it is that it refreshes the same page you were on rather than redirecting you to the account page, useful for customers not wanting to be taken away from an area they were previously on. And you are able to log in via the popup rather than loading a new page.


What about the fact its showing cache data from 1 customer to another in other browsers? Surely that's not normal behaviour I know the data it's showing is ultimately only the first name but who knows what else it could cache and show.
 
Last edited:
#4
I have also come across some other bugs, I tried an alternative temp workaround to not cache the customer version and just provide guest cache, but it has no effect, I cleared/purged the cache but it appears to have no effect I am still being served the same page.

Is there a solution to this and the above? Even if it's commercial support I am happy to pay for it within reason. It is quite a shame because LScache looks to be more promising than Nitropack, especially if the Opencart version of lscache eventually incorporates features on the Wordpresss version such as minification etc
 

serpent_driver

Well-Known Member
#5
What about the fact its showing cache data from 1 customer to another in other browsers ? Surely that's not normal behaviour I know the data its showing is ultimately only the first name but who knows what else it could cache and show.
This is a complete normal behaviour with every cache, not only LScache. If a page is cached there is no more PHP, only HTML and if no PHP there is no session. And if no session a user can't be differentiated form each other. To prevent this disadvantage of every cache LScache uses cache varies AND ESI, but to get one of it work a cookie must be set AND the page must be refreshed.

There is no perfect solution for it if AJAX is used, but only the one I already described before.
 

serpent_driver

Well-Known Member
#6
I have also come across some other bugs, I tried an alternative temp workaround to not cache the customer version and just provide guest cache, but it has no effect, I cleared/purged the cache but it appears to have no effect I am still being served the same page.
If you tell me the name of the login cookie, it can be done very easy.
 
#7
The solution seems to be available though if Nitropack was able to act on it? They made it so that when you use the pop-up login/register and press submit it forces the said page load... Can lscache not do that? Showing customer B data from customer A is not a violation of privacy?
 

serpent_driver

Well-Known Member
#9
Is there a solution to this and the above? Even if it's commercial support I am happy to pay for it within reason. It is quite a shame because LScache looks to be more promising than Nitropack, especially if the Opencart eventually incorporates features on the Wordpresss version such as minification etc
Lscache is able to do that, but the cache plugin can't. It needs an extra menue in the GUI.
 

serpent_driver

Well-Known Member
#10
Sure where do I look for this? I am familiar with the structure of Opencart but I have minimal to no coding skills

No need to know about OpenCart. Login to your shop and request a page that isn't cached. Press F12 key and check the tab for cookies. The name of the tab for cookies depends on browser.
 
#11
Another bug, opened the homepage of the test build this morning and I am being served the mobile version

https://dev.thepatchbay.co.uk/

I see that in the forum there was talk about this and a fix was brought to OC 3 version to use journal to check for the device but I have the version for 2.3 and I am not sure why im being shown a mobile version

No need to know about OpenCart. Login to your shop and request a page that isn't cached. Press F12 key and check the tab for cookies. The name of the tab for cookies depends on browser.
My apologies I am not sure what steps to take to reveal the cookie which specific tab/ step to take to show it?
 

serpent_driver

Well-Known Member
#12
I see that in the forum there was talk about this and a fix was brought to OC 3 version to use journal to check for the device but I have the version for 2.3 and I am not sure why im being shown a mobile version
This for device detection only and is something complete different to your issue.

My apologies I am not sure what steps to take to reveal the cookie which specific tab/ step to take to show it?
But you know what the F12 key is.....?
 
#16
I was logged in. Also important to note when I logged out, it still refreshed with a logged-in cache.

Is there something I am missing? something in htacess?
 

serpent_driver

Well-Known Member
#20
Copy and paste to your .htaccess. This (should ) disable cache for logged in users.

Code:
RewriteCond %{HTTP_COOKIE} _lscache_vary=session:loggedIn [NC]
RewriteRule .* - [E=Cache-Control:no-cache]
If it doesn't work log a ticket to get support from LiteSpeed support.
 
Top