Redirect and reload options not working
-
Hello,
Firstly, thanks for the plugin ??
We’re experiencing issues with the redirect and reload functionality when the session times out. Instead of redirecting or reloading, the browser stays on the same page and the first indication we get that the session has timed out is when the heartbeat fires, and WordPress throws the login modal.
We’ve experienced this issue with both ‘Logout and redirect to login page’ and ‘Logout user and redirect’.
After some debugging we’ve established that the issue appears to be with leading spaces in the ajax response. Instead of
true
we’re gettingtrue
(with two leading spaces) as theresponse
, which causes the following conditional to fail, resulting in neitherwindow.location
orwindow.reload
getting called.https://github.com/wp-plugins/idle-user-logout/blob/2.1/js/script.js#L58
Changing line 58 to
if( response.trim() == "true" ){
fixed the issue for us.Is this something you’re aware of? Has anyone else experienced this? Happy to submit a pull request if it’s a genuine issue.
Thanks,
Tom—
Plugin version: 2.1
Wordpress version: 4.2.3
- The topic ‘Redirect and reload options not working’ is closed to new replies.