<mxfile host="app.diagrams.net"><diagram id="cookie-session" name="How a session cookie returns"><mxGraphModel dx="900" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="900" pageHeight="900" background="#ffffff"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="shape-0" value="How a session cookie returns" style="text;html=0;whiteSpace=wrap;overflow=visible;align=left;verticalAlign=top;spacing=0;fontFamily=Arial;fontSize=27;fontColor=#172b4d;fontStyle=1;" vertex="1" parent="1"><mxGeometry x="36" y="26" width="828" height="26" as="geometry"/></mxCell>
<mxCell id="shape-1" value="A same-host session flow. The server still checks access on every request." style="text;html=0;whiteSpace=wrap;overflow=visible;align=left;verticalAlign=top;spacing=0;fontFamily=Arial;fontSize=18;fontColor=#526176;fontStyle=0;" vertex="1" parent="1"><mxGeometry x="36" y="70" width="828" height="26" as="geometry"/></mxCell>
<mxCell id="shape-2" value="" style="rounded=1;arcSize=12;whiteSpace=wrap;html=0;fillColor=#eff6ff;strokeColor=#1d4ed8;strokeWidth=1.75;dashed=0;" vertex="1" parent="1"><mxGeometry x="60" y="120" width="230" height="78" as="geometry"/></mxCell>
<mxCell id="shape-3" value="Browser" style="text;html=0;whiteSpace=wrap;overflow=visible;align=center;verticalAlign=top;spacing=0;fontFamily=Arial;fontSize=21;fontColor=#172b4d;fontStyle=1;" vertex="1" parent="1"><mxGeometry x="70" y="130" width="210" height="26" as="geometry"/></mxCell>
<mxCell id="shape-4" value="Stores eligible cookies" style="text;html=0;whiteSpace=wrap;overflow=visible;align=center;verticalAlign=top;spacing=0;fontFamily=Arial;fontSize=17;fontColor=#526176;fontStyle=0;" vertex="1" parent="1"><mxGeometry x="70" y="162" width="210" height="26" as="geometry"/></mxCell>
<mxCell id="shape-5" value="" style="rounded=1;arcSize=12;whiteSpace=wrap;html=0;fillColor=#ecfdf5;strokeColor=#047857;strokeWidth=1.75;dashed=0;" vertex="1" parent="1"><mxGeometry x="610" y="120" width="230" height="78" as="geometry"/></mxCell>
<mxCell id="shape-6" value="Application server" style="text;html=0;whiteSpace=wrap;overflow=visible;align=center;verticalAlign=top;spacing=0;fontFamily=Arial;fontSize=21;fontColor=#172b4d;fontStyle=1;" vertex="1" parent="1"><mxGeometry x="620" y="130" width="210" height="26" as="geometry"/></mxCell>
<mxCell id="shape-7" value="Validates the session" style="text;html=0;whiteSpace=wrap;overflow=visible;align=center;verticalAlign=top;spacing=0;fontFamily=Arial;fontSize=17;fontColor=#526176;fontStyle=0;" vertex="1" parent="1"><mxGeometry x="620" y="162" width="210" height="26" as="geometry"/></mxCell>
<mxCell id="shape-8" style="edgeStyle=none;rounded=0;html=0;strokeColor=#64748b;strokeWidth=2.25;endArrow=none;endFill=1;startArrow=none;startFill=1;dashed=1;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="175" y="198" as="sourcePoint"/><mxPoint x="175" y="824" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="shape-9" style="edgeStyle=none;rounded=0;html=0;strokeColor=#64748b;strokeWidth=2.25;endArrow=none;endFill=1;startArrow=none;startFill=1;dashed=1;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="725" y="198" as="sourcePoint"/><mxPoint x="725" y="824" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="shape-10" value="1  Submit login details" style="text;html=0;whiteSpace=wrap;overflow=visible;align=left;verticalAlign=top;spacing=0;fontFamily=Arial;fontSize=20;fontColor=#1d4ed8;fontStyle=1;" vertex="1" parent="1"><mxGeometry x="210" y="224" width="480" height="26" as="geometry"/></mxCell>
<mxCell id="shape-11" value="" style="rounded=1;arcSize=12;whiteSpace=wrap;html=0;fillColor=#eff6ff;strokeColor=#1d4ed8;strokeWidth=1.75;dashed=0;" vertex="1" parent="1"><mxGeometry x="210" y="258" width="480" height="99" as="geometry"/></mxCell>
<mxCell id="shape-12" value="POST /login HTTP/1.1&#xa;&#xa;[login data]" style="text;html=0;whiteSpace=wrap;overflow=visible;align=left;verticalAlign=top;spacing=0;fontFamily=Courier New;fontSize=17;fontColor=#172b4d;fontStyle=0;" vertex="1" parent="1"><mxGeometry x="226" y="270" width="448" height="75" as="geometry"/></mxCell>
<mxCell id="shape-13" style="edgeStyle=none;rounded=0;html=0;strokeColor=#1d4ed8;strokeWidth=2.25;endArrow=block;endFill=1;startArrow=none;startFill=1;dashed=0;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="175" y="375" as="sourcePoint"/><mxPoint x="725" y="375" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="shape-14" value="2  Return a session identifier" style="text;html=0;whiteSpace=wrap;overflow=visible;align=left;verticalAlign=top;spacing=0;fontFamily=Arial;fontSize=20;fontColor=#047857;fontStyle=1;" vertex="1" parent="1"><mxGeometry x="210" y="394" width="480" height="26" as="geometry"/></mxCell>
<mxCell id="shape-15" value="" style="rounded=1;arcSize=12;whiteSpace=wrap;html=0;fillColor=#ecfdf5;strokeColor=#047857;strokeWidth=1.75;dashed=0;" vertex="1" parent="1"><mxGeometry x="210" y="428" width="480" height="74" as="geometry"/></mxCell>
<mxCell id="shape-16" value="HTTP/1.1 200 OK&#xa;Set-Cookie: session=...; Secure; HttpOnly" style="text;html=0;whiteSpace=wrap;overflow=visible;align=left;verticalAlign=top;spacing=0;fontFamily=Courier New;fontSize=17;fontColor=#172b4d;fontStyle=0;" vertex="1" parent="1"><mxGeometry x="226" y="440" width="448" height="50" as="geometry"/></mxCell>
<mxCell id="shape-17" style="edgeStyle=none;rounded=0;html=0;strokeColor=#047857;strokeWidth=2.25;endArrow=block;endFill=1;startArrow=none;startFill=1;dashed=0;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="725" y="520" as="sourcePoint"/><mxPoint x="175" y="520" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="shape-18" value="3  Send a later eligible request" style="text;html=0;whiteSpace=wrap;overflow=visible;align=left;verticalAlign=top;spacing=0;fontFamily=Arial;fontSize=20;fontColor=#1d4ed8;fontStyle=1;" vertex="1" parent="1"><mxGeometry x="210" y="564" width="480" height="26" as="geometry"/></mxCell>
<mxCell id="shape-19" value="" style="rounded=1;arcSize=12;whiteSpace=wrap;html=0;fillColor=#eff6ff;strokeColor=#1d4ed8;strokeWidth=1.75;dashed=0;" vertex="1" parent="1"><mxGeometry x="210" y="598" width="480" height="74" as="geometry"/></mxCell>
<mxCell id="shape-20" value="GET /cart HTTP/1.1&#xa;Cookie: session=..." style="text;html=0;whiteSpace=wrap;overflow=visible;align=left;verticalAlign=top;spacing=0;fontFamily=Courier New;fontSize=17;fontColor=#172b4d;fontStyle=0;" vertex="1" parent="1"><mxGeometry x="226" y="610" width="448" height="50" as="geometry"/></mxCell>
<mxCell id="shape-21" style="edgeStyle=none;rounded=0;html=0;strokeColor=#1d4ed8;strokeWidth=2.25;endArrow=block;endFill=1;startArrow=none;startFill=1;dashed=0;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="175" y="690" as="sourcePoint"/><mxPoint x="725" y="690" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="shape-22" value="" style="rounded=1;arcSize=12;whiteSpace=wrap;html=0;fillColor=#ecfdf5;strokeColor=#047857;strokeWidth=1.75;dashed=1;" vertex="1" parent="1"><mxGeometry x="510" y="750" width="340" height="74" as="geometry"/></mxCell>
<mxCell id="shape-23" value="Look up the session and check&#xa;permission to access the cart." style="text;html=0;whiteSpace=wrap;overflow=visible;align=left;verticalAlign=top;spacing=0;fontFamily=Arial;fontSize=18;fontColor=#172b4d;fontStyle=0;" vertex="1" parent="1"><mxGeometry x="524" y="760" width="312" height="50" as="geometry"/></mxCell>
<mxCell id="shape-24" style="edgeStyle=none;rounded=0;html=0;strokeColor=#cbd5e1;strokeWidth=1;endArrow=none;endFill=1;startArrow=none;startFill=1;dashed=0;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="36" y="843" as="sourcePoint"/><mxPoint x="864" y="843" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="shape-25" value="Set-Cookie is a response header. Cookie is a request header. Cookie scope and browser rules apply." style="text;html=0;whiteSpace=wrap;overflow=visible;align=left;verticalAlign=top;spacing=0;fontFamily=Arial;fontSize=16;fontColor=#526176;fontStyle=0;" vertex="1" parent="1"><mxGeometry x="36" y="858" width="828" height="26" as="geometry"/></mxCell></root></mxGraphModel></diagram></mxfile>
