Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

johnw65's avatar

Laravel Web Site Session Expired Message

What is the best approach to let the users know that you session has expired and when it's expired it's redirect to the login page. The application makes lots of ajax calls and uses dataTables. So instead of the datatable displaying a cryptic message for the user, want the system to let the users know. Thanks.

0 likes
2 replies
martinbean's avatar
Level 80

@johnw65 When you make an AJAX request, if you get an unauthenticated error then display a modal or something saying, “You’re not logged in. Please log in to continue” or something, with a link that takes them to the login page.

johnw65's avatar

I see... there seems to be lots of good examples in jQuery. Thanks!

1 like

Please or to participate in this conversation.