--- tags: Laravel, livewire, token, lifetime --- # Session lifetime timeout and csrf token mismatch In app/Exceptions/Handler.php replace this: ``` public function render($request, Exception $e) { if ($e instanceof \Illuminate\Session\TokenMismatchException) { return redirect()->back()->withInput()->with('token', csrf_token()); } return parent::render($request, $e); } ``` ``` <div> <script> document.addEventListener('livewire:load', () => { setInterval(function(){ window.livewire.emit('alive'); }, 1800000); }); </script> </div> ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up