<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ronald</title>
    <description>The latest articles on DEV Community by Ronald (@rmirandasv).</description>
    <link>https://dev.to/rmirandasv</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F147166%2Fb251bd67-0930-45cf-8cb0-1e2f43728e2c.jpeg</url>
      <title>DEV Community: Ronald</title>
      <link>https://dev.to/rmirandasv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rmirandasv"/>
    <language>en</language>
    <item>
      <title>Should save acees token in local storage?</title>
      <dc:creator>Ronald</dc:creator>
      <pubDate>Sat, 30 Mar 2019 09:29:41 +0000</pubDate>
      <link>https://dev.to/rmirandasv/should-save-acees-token-in-local-storage-3o5o</link>
      <guid>https://dev.to/rmirandasv/should-save-acees-token-in-local-storage-3o5o</guid>
      <description>&lt;p&gt;Hi everybody! First I apologise if my English is not the best. It's not my native language. &lt;/p&gt;

&lt;p&gt;This is my first post, it's 3 am and I cannot sleep thinking in what's could be the best practices for a JavaScript front end application to authenticate the user?&lt;/p&gt;

&lt;p&gt;I'm building a PHP (Laravel) backend REST API to be consumed by a Vuejs + vuex app. I added authentication using Laravel passport and when user login the vue app request for an access token using the user credentials. Then store the token in a vuex store. Here all works fine, but if I make a full reload to the page, the vuex store it's initialized and the access token must be requested again. &lt;/p&gt;

&lt;p&gt;My question is, can I store the access token in the local storage to keep the user logged in even though reload page? Of course if I can do this I will manage expiration time for token, but...&lt;/p&gt;

&lt;p&gt;It's this secure? &lt;/p&gt;

&lt;p&gt;It's suppose an API must be stateless, so there is no reason to use server session and should not use Cookie's, right? If I can how to read token from cookie using JavaScript?? &lt;/p&gt;

&lt;p&gt;Any help would be great!&lt;/p&gt;

</description>
      <category>help</category>
      <category>javascript</category>
      <category>localstorage</category>
    </item>
  </channel>
</rss>
