This topic has 26 replies, 3 voices, and was last updated 2 years, 8 months ago ago by Olga Barlow
Hello,
we use the off canvas login option, but many times it redirects to my-account page and we need to login again, when page cache is enabled. This happens in 2 different sites with XStore theme.
When we disable cache, the login works always correctly. But, with cache enabled sometimes we are able to login, sometimes we are redirected to my-account login page and we need to enter our credentials again.
We use LiteSpeed cache, with ESI support.
How can we solve this issue?
Hello,
Could you, please, provide us with video of the issue for better understanding? You can use Recordit tool to create and share the video.
Regards
Hello,
I send you the video of the issue.
Hello,
It’s not related to cache. It’s because you try to use autosaved credentials for the off-canvas login popup. It does not support autosaved access. If you manually enter the login and password you won’t face any problems. Unfortunately, there is no way to allow using of autosaved access for the popups, sorry.
Regards
Hello,
I have just tried to manually enter the credentials, but it has the same issue.
It is strange as sometimes works ok either with autosaved or manually entered credentials.
However, if I disable the cache, it has no problem.
I tested also the registration tab and it has the same issue.
Hello,
Could you, please, provide us also with the user who has admin permissions to check the plugins you use and cache plugin settings?
Regards
Ok, I have added admin permissions to the user of my previous message.
Hello,
I see that you use Protect WP-Admin plugin. Try to disable this plugin, clear cache plugin and check if you still have the mentioned issue.
Regards
Hello,
I have disabled this plugin and cleared cache. But, the issue appears, after pages are cached again.
Hello,
Sorry for the delay in answering.
Try to disable all the third-party plugins, that do not come bundled with XStore https://www.8theme.com/documentation/xstore/plugins/included-plugins/ , clear all cache, and check then. Maybe one of the additional plugins is a reason for the problem. If it is true, enable plugins one by one to find out which one support you need to contact.
Let us know if any further assistance is needed from our side.
Regards
Hello,
after many tests on 2 websites, I am sure that the problem is caused by cache.
When a page is already cached by a different browser, the off-canvas login/register has problem. When a page is cached for the first time on the same browser, then it works.
If I disable cache completely, the off-canvas login/register has no problem and it works. It does not conflict with any other plugin.
Litespeed cache plugin uses ESI for the Woocommerce cart, so it works correct. I think, that if we make the off-canvas to use ESI cache, then it will work with no problems either for login/register, or for wishlist (icon and off-canvas).
How can we make the theme’s off-canvas compatible with this Litespeed ESI function?
Thanks
Hello,
Could you, please, disable Protect WP-Admin plugin and then reply back once you get a login issue with the cache and disabled plugin to allow us to check?
Regards
Ok, I disabled Protect WP-Admin plugin.
We still have the off-canvas login issue with the cache enabled.
Hello,
Did you disable plugin, clear cache and then issue appeared again? Or you just disabled plugin and did not clear cache after that?
Regards
Yes Olga, I cleared cache and after re-creating cache the issue appeared again.
Before a page is cached, the login is ok. After cache is created and then I visit the same page via another browser, the login has problem again.
Hello,
I’m checking your site and the login works ok. Even if the cache is enabled and when that plugin is disabled.
Regards
Hello,
today the login has problem again. We didn’t changed anything in the meanwhile.
You can try to login from homepage which is fully cached.
On any uncached page it works with no problem.
Regards
Hello,
I saw js errors in your console because of the LiteSpeed Cache lazy loading option https://prnt.sc/26d56w1 I temporary disabled Lazy loading. Let me know if you get the login issue again when this option is disabled.
Regards
Hello,
the problem started again. We haven’t changed anything since your last edit.
I think that a solution may be to make off-canvas block compatible with LS ESI and I try to find which file to edit.
Here is an example: https://docs.litespeedtech.com/lscache/lscwp/api/#generate-esi-block-url
Regards
Hello,
Check both sites now and let us know if it works ok for you now. If it works then we’ll add fix in the next theme update.
Regards
Hello,
now in the most pages it works, but they remain uncached.
I see this headers: x-litespeed-cache-control: no-cache
In some pages with x-litespeed-cache: hit
it doesn’t work.
What have you changed?
Hello,
We have improved the code. Check again.
Regards
Hello Olga,
with the last change it seems to work. But, it purges all cache on every login.
I’m thinking if it could help to treat the following as ESI:
woocommerce-login-nonce
woocommerce-register-nonce
Something like this:
do_action( ‘litespeed_nonce’, ‘woocommerce-login-nonce’ );
or
woocommerce-login-nonce no-cache
Hello,
Changed. Check again.
Regards
Hello,
with the last changes it seems to work ok.
The problem now comes only when we add something to cart and after a while we remove it from cart. When adding products to cart, the Litespeed private cache is enabled. If we empty the cart, the public cache comes back. But, I think something is getting confused. I will inform Litespeed’s support about this too.
Hello,
Ok. Glad to hear that the login option works ok for you now.
Regards
Tagged: cache, issue, login, off canvas, register, woocommerce, wordpress
You must be logged in to reply to this topic.Log in/Sign up