当前位置:网站首页>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 .
边栏推荐
- The way to treat feelings
- Integrated easy to pay secondary domain name distribution system
- flask 生成swagger文档
- Understanding of database architecture
- Pan for in-depth understanding of the attention mechanism in CV
- Compose LazyColumn 顶部添加控件
- FBI警告:有人利用AI换脸冒充他人身份进行远程面试
- There are several levels of personal income tax
- php-fpm的max_chindren的一些误区
- Php based campus lost and found platform (automatic matching push)
猜你喜欢
my. INI file not found
235. 二叉搜索樹的最近公共祖先【lca模板 + 找路徑相同】
Ego planner code parsing Bspline_ Optimizer section (2)
Nous avons fait une plateforme intelligente de règlement de détail
Valentine's Day - make an exclusive digital collection for your lover
Flutter网络和数据存储框架搭建 -b1
Record: solve the problem that MySQL is not an internal or external command environment variable
Dart JSON编码器和解码器剖析
记录在模拟器中运行flutter时报的错
【LeetCode】【SQL】刷题笔记
随机推荐
Analyse du Code du planificateur ego bspline Section Optimizer (1)
Smart wax therapy machine based on STM32 and smart cloud
application
Ego planner code parsing Bspline_ Optimizer section (1)
Failed to start component [StandardEngine[Catalina]. StandardHost[localhost]. StandardContext
达梦数据库的物理备份和还原简解
Typescript configuration
Understanding of database architecture
Thinking about festivals
Php based campus lost and found platform (automatic matching push)
Pytorch introduction to deep learning practice notes 13- advanced chapter of cyclic neural network - Classification
math_ Taylor formula
Does SQL always report foreign key errors when creating tables?
The more you talk, the more your stupidity will be exposed.
[optics] vortex generation based on MATLAB [including Matlab source code 1927]
Nous avons fait une plateforme intelligente de règlement de détail
Sqlalchemy - subquery in a where clause - Sqlalchemy - subquery in a where clause
SSM整合-前后台协议联调(列表功能、添加功能、添加功能状态处理、修改功能、删除功能)
Getting started with JDBC
Zero length array