<?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: eronaeon</title>
    <description>The latest articles on DEV Community by eronaeon (@eronaeon).</description>
    <link>https://dev.to/eronaeon</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%2F30912%2F38a24414-ead4-48e9-8861-dc6701425420.png</url>
      <title>DEV Community: eronaeon</title>
      <link>https://dev.to/eronaeon</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eronaeon"/>
    <language>en</language>
    <item>
      <title>What's the recommended method for designing secure and performant web sessions in 2018?</title>
      <dc:creator>eronaeon</dc:creator>
      <pubDate>Wed, 02 May 2018 11:16:00 +0000</pubDate>
      <link>https://dev.to/eronaeon/whats-the-recommended-method-for-designing-secure-and-performant-web-sessions-in-2018-2l26</link>
      <guid>https://dev.to/eronaeon/whats-the-recommended-method-for-designing-secure-and-performant-web-sessions-in-2018-2l26</guid>
      <description>&lt;p&gt;Hi all! designing sessions is very essential for all modern webapps, however there is very little discussion about it. Let's assume that a webapp uses HTTPS by default (i.e. no worries about eavesdropping or modifying cookies).&lt;/p&gt;

&lt;p&gt;Let's say I just want to design a session that stores only user id,  what's the best method to design sessions? from what I know:&lt;/p&gt;

&lt;h2&gt;
  
  
  Web based sessions:
&lt;/h2&gt;

&lt;p&gt;clearly the main disadvantage is I have to go to the database every http request and check the session ID. Sure I can use Redis to cache session ids, but also I have to implement a write through logic if I happen to update the session content so that Redis and the DB are synchronized&lt;/p&gt;

&lt;h3&gt;
  
  
  Django's approach
&lt;/h3&gt;

&lt;p&gt;just generate a random session id (long enough let's say more than 20 ascii chars) and store it in a cookie.&lt;/p&gt;

&lt;h3&gt;
  
  
  Express session's approach
&lt;/h3&gt;

&lt;p&gt;same as Django but also adds HMAC to the session id cookie (isn't this redundant for a HTTPS connection?)&lt;/p&gt;

&lt;h2&gt;
  
  
  Client based sessions:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  JWT
&lt;/h3&gt;

&lt;p&gt;lots of hate and critic about it even though it sounds pretty secure and more performant, and I am not sure how many respectable websites that actually implement it&lt;/p&gt;




&lt;p&gt;What do you recommend? what's the current recommended method for designing session logic for a website (hopefully that could be extended to a mobile app) in 2018?&lt;/p&gt;

</description>
      <category>discuss</category>
    </item>
  </channel>
</rss>
