title: Laravel javascript logout
body: <p>What is the best practice, if something wrong happens, in a client-side (of a laravel 5.4 project) in a JavaScript code, for example the code is not able to find the important cookies? </p>
  
  <p>So how can I make a code what is automatically log-out the user (with an error message) if some error occours? Is there any simple library or method, what should I use in this case?</p>
  
  <p>Thanks for the answers and suggestions in advance!</p>