Plugin Support
qtwrk
(@qtwrk)
Hi,
ajax doesn’t get cached , you can verify it by HTTP response header, for any ajax call you should see “x-litespeed-cache-control: no-cache” on it.
when it freezes, do you see any error message ? what is the status code on that ajax request ? this is more like nonce issue.
Best regards,
Thread Starter
RezaY
(@mohammad983)
I use this code after successful login
response = JSON.parse(response);
if(response.status == 'success'){
formSuccessArea.html(response.message);
location.reload();
}
it just reloads the page and doesn’t log in!
I change to location.replace(‘/profile’);
I realize when the plugin is active replace method after login does not work. but as soon as disable the plugin. users after logging redirects to profile page.
by the way the result of console.log(currentAjax.getAllResponseHeaders()) is
access-control-allow-credentials: true
access-control-allow-origin: https://www.my.com
cache-control: no-cache, must-revalidate, max-age=0
content-encoding: br
content-length: 125
content-type: text/html; charset=UTF-8
date: Mon, 14 Dec 2020 13:23:29 GMT
expires: Wed, 11 Jan 1984 05:00:00 GMT
referrer-policy: strict-origin-when-cross-origin
server: LiteSpeed
vary: Accept-Encoding
x-content-type-options: nosniff
x-firefox-spdy: h2
x-frame-options: SAMEORIGIN
x-litespeed-cache-control: no-cache
x-robots-tag: noindex
-
This reply was modified 5 years, 4 months ago by
RezaY.
Plugin Support
qtwrk
(@qtwrk)
Hi,
when you successfully logged in , did you see , by dev tool , _lscache_vary cookie being sent/set ?
x-litespeed-cache-control: no-cache —> this shows that request is not being cached.
I change to location.replace(‘/profile’);
I realize when the plugin is active replace method after login does not work. but as soon as disable the plugin. users after logging redirects to profile page
I think might be the JS code is being cached
could you please try login_redirect hook and see how that goes ?
Best regards,
Thread Starter
RezaY
(@mohammad983)
login_redirect hook works. thanks