当前位置:网站首页>Basic usage, principle and details of session
Basic usage, principle and details of session
2022-07-01 04:36:00 【Rain |】
Session tracking technology stored on the server
JavaEE Provide HttpSession Interface ,Session Similar to a domain on the server
Basic use :
establish Session object :
HttpSession session = request.getSession()
session.setAttribute(String name,Object o) Store in Session domain
session.getAttribute(String name) Get by key Session Data in domain
session.removeAttribute(String name) Delete Session Data in domain
Case study :


principle :
Session Is based on Cookie Realized , Exists in the program Session when ,Tomcat Will automatically detect , And create the corresponding response header set-Cookie:JSSESSIONID = ... Send it to the browser , The browser wants to access Session The request header will be issued when the domain Cookie: JSSESSIONID = …, Not like Cookie Send data directly .

details :
Session Activation of , passivation :
Session It will not disappear immediately after the server is shut down normally ,
passivation :
When the server is shut down normally ,Session Store the data in the hard disk of the server ,target/work Under the folder
activation :
When the server starts again ,Session Re extract the data stored in the hard disk Session data , establish Session Domain , Delete the files stored on the hard disk
Session Survival time :
The default is 30 minute
It can be configured in Web.xml Configure lifetime
<session-config>
<session-timeout>90</session-timeout>
</session-config>
Delete Session:
session.invalidate();
effect : Exit account
边栏推荐
- Daily question - line 10
- Odeint and GPU
- 1. Mobile terminal touch screen event
- [deep learning] (4) decoder mechanism in transformer, complete pytoch code attached
- 2. Use of classlist (element class name)
- (12) Somersault cloud case (navigation bar highlights follow)
- Concurrent mode of different performance testing tools
- Common interview questions ①
- Internet winter, how to spend three months to make a comeback
- 【深度学习】(4) Transformer 中的 Decoder 机制,附Pytorch完整代码
猜你喜欢

JD intelligent customer service Yanxi intention system construction and intention recognition technology introduction

Class and object finalization

It's settled! 2022 JD cloud summit of JD global technology Explorer conference see you in Beijing on July 13

25.k sets of flipped linked lists

Odeint and GPU

2022年聚合工艺考试题及模拟考试

Dual Contrastive Learning: Text Classification via Label-Aware Data Augmentation 阅读笔记

In the innovation community, the "100 cities Tour" of the gold warehouse of the National People's Congress of 2022 was launched

JS image path conversion Base64 format

Software testing needs more and more talents. Why do you still not want to take this path?
随机推荐
MySQL advanced -- you will have a new understanding of MySQL
CUDA development and debugging tool
Offline installation of Wireshark 2.6.10
Mallbook: how can hotel enterprises break the situation in the post epidemic era?
2022.2.7-2.13 AI industry weekly (issue 84): family responsibilities
Concurrent mode of different performance testing tools
The junior college students were angry for 32 days, four rounds of interviews, five hours of soul torture, and won Ali's offer with tears
OdeInt與GPU
[learn C and fly] S1E20: two dimensional array
1. Mobile terminal touch screen event
Daily question - line 10
Ospfb notes - five messages [ultra detailed] [Hello message, DD message, LSR message, LSU message, lsack message]
JD intelligent customer service Yanxi intention system construction and intention recognition technology introduction
Question bank and answers for chemical automation control instrument operation certificate examination in 2022
软件研发的十大浪费:研发效能的另一面
Selenium opens the Chrome browser and the settings page pops up: Microsoft defender antivirus to reset your settings
Task04 | statistiques mathématiques
TCP/IP 详解(第 2 版) 笔记 / 3 链路层 / 3.4 桥接器与交换机 / 3.4.2 多属性注册协议(Multiple Registration Protocol (MRP))
Procurement intelligence is about to break out, and Alipay'3+2'system helps enterprises build core competitive advantages
LM small programmable controller software (based on CoDeSys) note 20: PLC controls stepping motor through driver