当前位置:网站首页>Additional: [login information storage] and [login status verification]; (including: summarizing all the contents of [login information storage] and [login status verification] so far;)
Additional: [login information storage] and [login status verification]; (including: summarizing all the contents of [login information storage] and [login status verification] so far;)
2022-07-02 22:39:00 【Small withered forest】
explain :
(1) Why did you write this blog ?:
● stay 【27: The third chapter : Developing a pass service :10:【 register / Sign in 】 Interface : register / Sign in OK after , Send the user session information (uid,utoken) Save to redis and cookie in ;】 in , Register in development / When logging into the interface , We put the user session related information (uid and utoken), They exist separately 【 Front end browsing cookie】 and 【 Back end redis】;
● Obviously , This is for all the following “ Need to verify user login ” Prepare for the situation ; however , This is the practice in the case of distributed microservices ; and , I am relatively unfamiliar with this ;
● therefore , In order to better understand the above practice ;;; Feeling , Need to summarize , All the contents about login verification encountered before ;
(2) The content of this blog , Understanding may be biased 、 Incomplete 、 Even the wrong place ;
Catalog
3、 ... and :【 (17)SSM Develop Book Review Network 】: One SSM project ;
Four :【(19)Spring Boot E-commerce projects 】: One Spring Boot project ;
5、 ... and : The solution of this project ;
One :【(6) Enterprise portal case , Project development knowledge points ;】: A simple Servlet project ;
The project is simple , Login verification is not used ;
Two :【(12) MOOC OA System (Mybatis Project case , More important !)】 : One is used Mybatis Of Servlet project ;
The basic logic of this project is :
● When logging in , It stores the information of the logged in user session in ;
● In some places where you need to have a current login user , It will try from session Get the current login user information in ;;; If session There is login user information in , Everything OK;;; If not , The null pointer exception will be reported ;
(1) Front end landing page , enter one user name / After the password , If login is successful , Just put the information of the currently logged in user , It's stored in Session In the object ;
● After the above login is successful , Will jump to the page ;;;
● then , Jump to the new page , It will automatically call other interfaces ;
(2) then , In other places where you need the information of the currently logged in user , In this interface , Will try to start from session Get the current login user information in ;;; If session There is login user information in , Everything OK;
(3) natural , When you sign out here , Is to put Session Delete the data of user information in ( Or just put that session Get reimbursed );
(4) then , If at this time , Let's visit those 【 need session in , Interface with user information 】 when , Interface to try from session The statement to obtain user information in will report a null pointer exception ;
3、 ... and :【(17)SSM Develop Book Review Network 】: One SSM project ;
(1) register OK after , It just jumps to the login page ;
(2) After successful login , It stores user information in session In the object ;
(3) then , In other interfaces that require user login , from session Get user information in the object ;
Four :【(19)Spring Boot E-commerce projects 】: One Spring Boot project ;
(1) After successful login , User information is also stored in session In the object ;
(2) then , In other interfaces that require user login , from session Get user information in the object ;;; If you can get , Everything goes smoothly ;;; If not , Throw an exception ;
5、 ... and : The solution of this project ;
Simply speaking , This project is used to save user login information at the back end , There is no session, But use Redis;
however , Some distributed micro service projects , On the back end, it seems that the information is still stored session Medium , This seems to involve sharing session Wait for the content ;
Own to share session The content such as , Do not know much about , At present, there is no need to see ; When needed later , It's not too late to look for relevant information ;
边栏推荐
- 《ActBERT》百度&悉尼科技大学提出ActBERT,学习全局局部视频文本表示,在五个视频-文本任务中有效!
- 【微服务|Sentinel】重写sentinel的接口BlockExceptionHandler
- NC24325 [USACO 2012 Mar S]Flowerpot
- Get off work on time! Episode 6 of Excel Collection - how to split and count document amounts
- Based on asp Net (used mobile phone sales management system) +asp Net+c # language +vs2010+ database can be used for course design and post design learning
- 影视随摘
- Micro service gateway selection, please accept my knees!
- scrcpy这款软件解决了和同事分享手机屏幕的问题| 社区征文
- It's not easy to say I love you | use the minimum web API to upload files (swagger support) # yyds dry inventory #
- Oracle-游标
猜你喜欢

From "bronze" to "King", there are three secrets of enterprise digitalization

Ransack combined condition search implementation

Landingsite eband B1 smoke test case

《Just because》阅读感受

任务和特权级保护

Task and privilege level protection

Tencent three sides: in the process of writing files, the process crashes, and will the file data be lost?

20220702-程序员如何构建知识体系?

What is it that makes you tremble? Those without fans can learn

Share how to make professional hand drawn electronic maps
随机推荐
#include errors detected. Please update your includePath.
Official announcement! The golden decade of new programmers and developers was officially released
Socket socket c/s end process
Market Research - current market situation and future development trend of night vision goggles for pilots
Web side defense Guide
"New programmer 003" was officially launched, and the cloud native and digital practical experience of 30+ companies such as Huawei and Alibaba
Using emqx cloud to realize one machine one secret verification of IOT devices
Regular expression (2)
Simpleitk use - 4 Strange question
服务可见可观测性
Dynamic memory allocation (malloc calloc realloc free)
[QT] QT multithreading development - reentrancy and thread safety
[autosar-dcm] - 4.3-how UDS $22 and $2e services read and write NVM data
Market Research - current situation and future development trend of anterior cruciate ligament (ACL) reconstruction Market
U++ learning notes - relaxation
Tencent three sides: in the process of writing files, the process crashes, and will the file data be lost?
Phpcms realizes the direct Alipay payment function of orders
Based on asp Net (used mobile phone sales management system) +asp Net+c # language +vs2010+ database can be used for course design and post design learning
php实现根据输入的年龄查询出生日期符合的数据
[shutter] shutter custom fonts (download TTF fonts | pubspec.yaml configure font resources | synchronize resources | globally apply fonts | locally apply fonts)









