What is the best way to handle expired tokens in laravel 5.
I mean I have a page and it has some links which perform ajax requests. They work fine when the page is
a short and fast way.... for handling ajax requests,when token expire : add this script to the end of master layout or your document
$(window).load(function(){
$.ajaxSetup({
statusCode: {
419: function(){
location.reload();
}
}
});
});
and for handling http requests when token expires, create 419.blade.php in this path: \resources\views\errors and add this script to it: