当前位置:网站首页>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 ;
边栏推荐
- Market Research - current market situation and future development trend of aircraft wireless intercom system
- SimpleITK使用——4. 奇怪的问题
- Socket socket c/s end process
- U++ 学习笔记 ----松弛
- Les trois principaux points de douleur traités par servicemesh
- What is it that makes you tremble? Those without fans can learn
- [shutter] shutter resource file use (import resource pictures | use image resources)
- Simpleitk use - 4 Strange question
- Basic concepts of image and deep understanding of yuv/rgb
- Hanoi Tower problem
猜你喜欢

【ODX Studio编辑PDX】-0.1-如何快速查看各Variant变体间的支持的诊断信息差异(服务,Sub-Function...)

Task and privilege level protection

Kubernetes resource object introduction and common commands (4)

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

数学建模——图与网络模型及方法(一)

【外刊】睡眠与减肥

LightGBM原理及天文数据中的应用

An overview of the development of affective computing and understanding research
![[shutter] shutter application theme (themedata | dynamic modification theme)](/img/77/6b0082368943aee7108ac550141f28.gif)
[shutter] shutter application theme (themedata | dynamic modification theme)
![[shutter] shutter page life cycle (initialization period | createstate | initstate | update period | build | destroy period | dispose)](/img/07/6f2dfb543cb0ab4f27169da7e6ad07.jpg)
[shutter] shutter page life cycle (initialization period | createstate | initstate | update period | build | destroy period | dispose)
随机推荐
Market Research - current market situation and future development trend of handheld wound imaging equipment
Micro service gateway selection, please accept my knees!
Dynamic memory allocation (malloc calloc realloc free)
使用 EMQX Cloud 实现物联网设备一机一密验证
佩服,竟然有人把高等数学这么晦涩难懂的科目,讲解得如此通俗易懂
Reading experience of just because
Unity publishes a method of webgl playing sound
Notes on key vocabulary in the English original of the biography of jobs (10) [chapter eight]
Les trois principaux points de douleur traités par servicemesh
数据库系统概论第一章简答题-期末考得怎么样?
Unity3D学习笔记4——创建Mesh高级接口
php优化foreach中的sql查询
C language, to achieve three chess games
[shutter] shutter resource file use (import resource pictures | use image resources)
【C 题集】of Ⅴ
Market Research - current market situation and future development trend of total nutrition products
U++ learning notes - relaxation
Servicemesh mainly solves three pain points
【AUTOSAR-DCM】-4.3-UDS $22和$2E服务如何读取和写入NVM数据
[001] [arm-cortex-m3/4] internal register









