<mxfile host="app.diagrams.net"><diagram name="Cookie-based (session) authentication" id="d1"><mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1200" pageHeight="735" background="#FFFFFF" math="0" shadow="0"><root><mxCell id="0" /><mxCell id="1" parent="0" /><mxCell id="c2" value="" style="html=1;rounded=0;endArrow=none;endFill=1;startArrow=none;startFill=1;strokeColor=#A19F9D;strokeWidth=1.2;dashed=1;dashPattern=6 4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1000.0" y="158.0" as="sourcePoint" /><mxPoint x="1000.0" y="700.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c3" value="" style="html=1;rounded=0;endArrow=none;endFill=1;startArrow=none;startFill=1;strokeColor=#A19F9D;strokeWidth=1.2;dashed=1;dashPattern=6 4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="600.0" y="158.0" as="sourcePoint" /><mxPoint x="600.0" y="700.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c4" value="" style="html=1;rounded=0;endArrow=none;endFill=1;startArrow=none;startFill=1;strokeColor=#A19F9D;strokeWidth=1.2;dashed=1;dashPattern=6 4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="200.0" y="158.0" as="sourcePoint" /><mxPoint x="200.0" y="700.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c5" value="&lt;b&gt;Cookie-based (session) authentication&lt;/b&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontSize=22;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="40.0" y="18.0" width="1120.0" height="30.0" as="geometry" /></mxCell><mxCell id="c6" value="&lt;span style=&quot;font-size:13.5px;color:#605E5C&quot;&gt;Sign in once, then the browser replays a session cookie on every request&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;fontSize=15;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="40.0" y="50.0" width="1120.0" height="22.0" as="geometry" /></mxCell><mxCell id="c7" value="" style="html=1;rounded=0;endArrow=none;endFill=1;startArrow=none;startFill=1;strokeColor=#0078D4;strokeWidth=2;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="40.0" y="82.0" as="sourcePoint" /><mxPoint x="1160.0" y="82.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c8" value="&lt;b&gt;Browser&lt;/b&gt;&lt;br&gt;&lt;span style=&quot;font-size:12.5px;color:#605E5C&quot;&gt;user agent&lt;/span&gt;" style="rounded=1;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=16;fillColor=#F3F2F1;strokeColor=#8A8886;strokeWidth=1.5;fontColor=#323130;fontSize=14;fontFamily=Helvetica;align=center;verticalAlign=middle;spacingLeft=12;spacingRight=12;spacingTop=0;" vertex="1" parent="1"><mxGeometry x="70.0" y="100.0" width="260.0" height="58.0" as="geometry" /></mxCell><mxCell id="c9" value="&lt;b&gt;Web application&lt;/b&gt;&lt;br&gt;&lt;span style=&quot;font-size:12.5px;color:#605E5C&quot;&gt;server-side session&lt;/span&gt;" style="rounded=1;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=16;fillColor=#DFF6DD;strokeColor=#107C10;strokeWidth=1.5;fontColor=#323130;fontSize=14;fontFamily=Helvetica;align=center;verticalAlign=middle;spacingLeft=12;spacingRight=12;spacingTop=0;" vertex="1" parent="1"><mxGeometry x="470.0" y="100.0" width="260.0" height="58.0" as="geometry" /></mxCell><mxCell id="c10" value="&lt;b&gt;Session store&lt;/b&gt;&lt;br&gt;&lt;span style=&quot;font-size:12.5px;color:#605E5C&quot;&gt;memory, cache or database&lt;/span&gt;" style="rounded=1;whiteSpace=wrap;html=1;absoluteArcSize=1;arcSize=16;fillColor=#DFF6DD;strokeColor=#107C10;strokeWidth=1.5;fontColor=#323130;fontSize=14;fontFamily=Helvetica;align=center;verticalAlign=middle;spacingLeft=12;spacingRight=12;spacingTop=0;" vertex="1" parent="1"><mxGeometry x="870.0" y="100.0" width="260.0" height="58.0" as="geometry" /></mxCell><mxCell id="c11" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="200.0" y="215.0" as="sourcePoint" /><mxPoint x="598.0" y="215.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c12" value="1" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="210.0" y="203.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c13" value="POST /login&lt;br&gt;&lt;span style=&quot;font-size:11.0px;color:#605E5C&quot;&gt;username + password (HTML form)&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="297.5" y="168.6" width="205.0" height="36.4" as="geometry" /></mxCell><mxCell id="c14" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="600.0" y="290.0" as="sourcePoint" /><mxPoint x="998.0" y="290.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c15" value="2" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="610.0" y="278.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c16" value="create session&lt;br&gt;&lt;span style=&quot;font-size:11.0px&quot;&gt;&lt;font face=&quot;Courier New&quot;&gt;abc123 → { user, roles }&lt;/font&gt;&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="712.5" y="243.6" width="175.0" height="36.4" as="geometry" /></mxCell><mxCell id="c17" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="600.0" y="375.0" as="sourcePoint" /><mxPoint x="202.0" y="375.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c18" value="3" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="566.0" y="363.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c19" value="302 Found&lt;br&gt;&lt;span style=&quot;font-size:11.0px&quot;&gt;&lt;font face=&quot;Courier New&quot;&gt;Set-Cookie: session=abc123; HttpOnly; Secure&lt;/font&gt;&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="245.4" y="328.6" width="309.2" height="36.4" as="geometry" /></mxCell><mxCell id="c20" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="200.0" y="460.0" as="sourcePoint" /><mxPoint x="598.0" y="460.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c21" value="4" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="210.0" y="448.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c22" value="GET /orders&lt;br&gt;&lt;span style=&quot;font-size:11.0px&quot;&gt;&lt;font face=&quot;Courier New&quot;&gt;Cookie: session=abc123&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-size:11.0px;color:#605E5C&quot;&gt;attached automatically by the browser&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="279.0" y="398.4" width="241.9" height="51.6" as="geometry" /></mxCell><mxCell id="c23" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="600.0" y="535.0" as="sourcePoint" /><mxPoint x="998.0" y="535.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c24" value="5" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="610.0" y="523.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c25" value="lookup abc123&lt;br&gt;&lt;span style=&quot;font-size:11.0px;color:#605E5C&quot;&gt;on every request (stateful)&lt;/span&gt;" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="709.8" y="488.6" width="180.3" height="36.4" as="geometry" /></mxCell><mxCell id="c26" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;dashed=1;dashPattern=6 4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1000.0" y="600.0" as="sourcePoint" /><mxPoint x="602.0" y="600.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c27" value="{ user, roles }" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="740.5" y="568.8" width="119.0" height="21.2" as="geometry" /></mxCell><mxCell id="c28" value="" style="html=1;rounded=0;endArrow=block;endFill=1;startArrow=none;startFill=1;strokeColor=#323130;strokeWidth=1.6;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="600.0" y="670.0" as="sourcePoint" /><mxPoint x="202.0" y="670.0" as="targetPoint" /></mxGeometry></mxCell><mxCell id="c29" value="6" style="ellipse;whiteSpace=wrap;html=1;fillColor=#0078D4;strokeColor=#FFFFFF;strokeWidth=1.5;fontColor=#FFFFFF;fontStyle=1;fontSize=12;fontFamily=Helvetica;" vertex="1" parent="1"><mxGeometry x="566.0" y="658.0" width="24.0" height="24.0" as="geometry" /></mxCell><mxCell id="c30" value="200 OK" style="text;html=1;strokeColor=none;fillColor=white;align=center;verticalAlign=middle;whiteSpace=wrap;fontSize=12.5;fontColor=#323130;fontFamily=Helvetica;spacing=0;" vertex="1" parent="1"><mxGeometry x="372.0" y="638.8" width="56.0" height="21.2" as="geometry" /></mxCell></root></mxGraphModel></diagram></mxfile>