You are here

public function AutologoutController::ajaxSetLast in Automated Logout 8

Ajax callback to reset the last access session variable.

1 string reference to 'AutologoutController::ajaxSetLast'
autologout.routing.yml in ./autologout.routing.yml
autologout.routing.yml

File

src/Controller/AutologoutController.php, line 94

Class

AutologoutController
Returns responses for autologout module routes.

Namespace

Drupal\autologout\Controller

Code

public function ajaxSetLast() {
  $_SESSION['autologout_last'] = $this->time
    ->getRequestTime();

  // Reset the timer.
  $response = new AjaxResponse();
  $markup = $this->autoLogoutManager
    ->createTimer();
  $response
    ->addCommand(new ReplaceCommand('#timer', $markup));
  return $response;
}