HTTP State Management 1710327365

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Internet Engineering

💡 tips

Management

SWIPE
What is HTTP

1. URL 2. HTTP Request


user browser server

4. Webpage 3. HTTP Response

HTTP is a protocol.
It allows web browsers and servers to
communicate by exchanging requests
and responses.
HTTP Multiple connections mode
Client Server
open

close

TCP connection
open

close

Using more than one TCP connection to send


and receive HTTP requests and responses.
HTTP keep-alive mode

Client Server
TCP connection
open

close

This allows a single TCP connection to remain


open for multiple HTTP requests/responses.
HTTP is stateless!

client server

stateless

TCP connection

Because it does not remember anything


between HTTP requests in both of Multiple
connections or Keep-alive modes.
HTTP state management
Is a mechanism that specifies a way to create a
stateful session with HTTP requests and responses.

State can be stored using several


approaches
Cookies

Session State

Query strings

Hidden fields

Each of these approaches has a


specific usage and you can have all of
them in one system.
Cookies
Cookies are small files that server put on your
Browser to store info about your preferences.

Client Server
open HTTP Header

Set-Cookies UserInfo
name : jack

• Sent with every request


close
• Size should be small
• Usually restrict cookie size to 4096 bytes
Takes some time • Cookies are dependent on domain
• Can be deleted by users
• It’s Expirable on client
open • Accessible by user

Server Fetches data


from HTTP header
cookies

close
Session State
Server-side scenario for storage of user data while
the user browses a web app.

Client Server
open
in server-side
Create Session

Set-Cookies al_session
Id value : ZUrAbK0cAcx…

close
open End Point
Session Dictionary

Create a task
Add To user session
find user session by id in
ai_session cookie
close
open
End Point

Fetch data from user session

close

• Session ID sent with every request


• ID used by the app to fetch the session data
• Sessions aren't shared across browsers
• Session cookies are deleted when the browser session ends
Query strings
A limited amount of data can be passed from one
request to another by adding it to the new request's
query string.

Client Panel Svr Identity Provider

Get Admin/Users

Get Login? scope=Panel&…..

Query strings

• Query strings are public


• Not good for sensitive data
• Can expose the app to CSRF attacks
Hidden fields
Data can be saved in hidden form fields and posted
back on the next request.

Client Panel Svr Identity Provider

Get Home/Index

Response

• This is common in multi-page forms


• Must always revalidate the fields
・Please follow me
・Click on the notification bell on my profile

@thisisnabi

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy