I can only think of two ways to do this
- Add the information to the session and read it from there.
- Use the browsers local storage.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi there!
I want to make my Laravel 9 project to easier for my users by keep the previously opened form/page to be reload again as it was, which had been redirected to login page because of session timeout due to inactivity.
Another scenario I want to handle the CSRF token also need to be refreshed, after the re-login on one browser tabs need to re-activate all other opened tabs with CSRF. Detailed example below, If I opened my project in 2 browser tabs (tab A, tab B). I filled tab A form inputs partially which is a ajax form and haven't used both the tabs for around 2.5 hours(SESSION_LIFETIME=120 already set & waited for that time to exceeded) and I refreshed the tab B then done re-logged in with the same user account.
After that I filled the tab B form balance inputs and pressed submit button returns me 419 -Page Expired or csrf token mismatched errors, which makes the data loss on the tab A
Could someone help me to how can I achieve this in Laravel 9?
Please or to participate in this conversation.