This refers to the commit referred here: https://github.com/piwik/piwik/pull/7686 So, if the user has logged into the application and did not interact for more than 3 days. Then he is logged out of the site automatically. (For now, forget about users who have set "Remember my login") The code I prepared, do this in the given commit.
So, for this scenario, I am trying to set the twig view variable in [b]function authenticateAndRedirect($login, $password, $rememberMe, $urlToRedirect = false, $passwordHashed = false)[/b] in Login controller only for logged in user (not for any other users)
$view = new View('@CoreHome/getDefaultIndexView');
$view->jsSpecialVariable = true;
So, I need to access this jsSpecialVariable from getDefaultIndexView.twig template because I could load the script only if the user is authenticated user.
The biggest advantage in this approach when compared with Aubry’s suggestion of server-side validation is that it’s fully done at client side and there is no HTTP round-trip to server. I hope you would guide me right.
Please ASK if you need clarification.