当前位置:网站首页>Web Security (VII) specific process of authentication with session cookie scheme
Web Security (VII) specific process of authentication with session cookie scheme
2022-07-03 19:08:00 【jinyangjie0】
summary
every time web request , Actually by sessionId To identify the request session .
1、 When the client successfully requests the login interface and passes the authentication , The server records this time session Information , And put seesionId Back to the client , The client stores the information in cookie.
2、 When the same user sends a new request , Will be able to sessionId close , The server compares the existing session Information , User identity can be recognized .
Describe the process in more detail
1、 The user sends the user name to the server 、 password 、 The captcha is used to log in to the system .
2、 After the server is verified , The server creates a Session, And will Session Information stored .
3、 The server returns a... To the user SessionID, Write the user's Cookie.
4、 When the user remains logged in ,Cookie Will be sent with each subsequent request .
5、 The server can store in Cookie Upper SessionID And stored in memory or database Session Compare information , To authenticate the user , When the response information is returned to the user's client, the current status of the user will be attached .
Use Session Precautions for
1、 rely on Session Make sure the client is turned on Cookie.
2、 Be careful Session The expiration time of .
Multi server nodes Session-Cookie How to do it ?
When the server level expands to multiple nodes , Problems that may cause user login information to be out of sync .
Reference plan :
1、 All requests of a user are allocated to the same server for processing through the hash policy of the feature . In this case , Each server holds a portion of the user's Session Information . Server down , All that it keeps Session The information is completely lost .
2、 Every server keeps Session Information is synchronized with each other , That is to say, every server has saved the full amount of Session Information . Every time a server Session Information changes , We'll synchronize it to other servers . It's too expensive , also , More nodes , The higher the cost of synchronization .
3、 Use a single data node that all servers can access ( Such as caching ) To hold the Session Information . To ensure high availability , Try to avoid single data node .
边栏推荐
- Scrape crawler framework
- 【数学建模】基于matlab船舶三自由度MMG模型【含Matlab源码 1925期】
- [mathematical modeling] ship three degree of freedom MMG model based on MATLAB [including Matlab source code 1925]
- php-fpm的max_chindren的一些误区
- 硬盘监控和分析工具:Smartctl
- [water quality prediction] water quality prediction based on MATLAB Fuzzy Neural Network [including Matlab source code 1923]
- shell 脚本中关于用户输入参数的处理
- Simulation scheduling problem of SystemVerilog (1)
- math_泰勒公式
- Valentine's Day - make an exclusive digital collection for your lover
猜你喜欢

Transformer T5 model read slowly

Pytorch introduction to deep learning practice notes 13- advanced chapter of cyclic neural network - Classification

What does a really excellent CTO look like in my eyes

SQL custom collation

Record: MySQL changes the time zone

记录在模拟器中运行flutter时报的错

Su embedded training - Day10

EGO Planner代码解析bspline_optimizer部分(3)
Know what it is, and know why, JS object creation and inheritance [summary and sorting]

Dart JSON编码器和解码器剖析
随机推荐
Zero length array
Simple solution of physical backup and restore of Damon database
Which do MySQL and Oracle learn?
__ Weak and__ The difference between blocks
C enum contains value - C enum contains value
math_ Taylor formula
Flask generates swagger documents
[leetcode] [SQL] notes
The earliest record
How can I avoid "div/0!" Errors in Google Docs spreadsheet- How do I avoid the '#DIV/0!' error in Google docs spreadsheet?
application
【LeetCode】【SQL】刷题笔记
What does a really excellent CTO look like in my eyes
Chisel tutorial - 06 Phased summary: implement an FIR filter (chisel implements 4-bit FIR filter and parameterized FIR filter)
php-fpm的max_chindren的一些误区
Record: writing MySQL commands
How to read the source code [debug and observe the source code]
ActiveMQ的基础
235. The nearest common ancestor of the binary search tree [LCA template + same search path]
Streaming media server (16) -- figure out the difference between live broadcast and on-demand