当前位置:网站首页>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
边栏推荐
- Possible problems and solutions of using scroll view to implement slider view
- [human version] Web3 privacy game in the dark forest
- Selenium opens the Chrome browser and the settings page pops up: Microsoft defender antivirus to reset your settings
- Maixll-Dock 使用方法
- [godot] unity's animator is different from Godot's animplayer
- NFT: start NFT royalty journey with eip-2981
- Note de développement du système embarqué 80: application du concepteur Qt à la conception de l'interface principale
- 离线安装wireshark2.6.10
- JMeter learning notes 2 - brief introduction to graphical interface
- Registration for R2 mobile pressure vessel filling test in 2022 and R2 mobile pressure vessel filling free test questions
猜你喜欢
![Ospfb notes - five messages [ultra detailed] [Hello message, DD message, LSR message, LSU message, lsack message]](/img/aa/a255d225d71e6ba2b497f8d59f5f11.jpg)
Ospfb notes - five messages [ultra detailed] [Hello message, DD message, LSR message, LSU message, lsack message]
![[leetcode skimming] February summary (updating)](/img/62/0d0d9f11434e49d33754a2e4f2ea65.jpg)
[leetcode skimming] February summary (updating)

LM small programmable controller software (based on CoDeSys) note 19: errors do not match the profile of the target

Maixll-Dock 使用方法
![[recommended algorithm] C interview question of a small factory](/img/ae/9c83efe86c03763710ba5e4a2eea33.jpg)
[recommended algorithm] C interview question of a small factory

尺取法:有效三角形的个数

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

MySQL winter vacation self-study 2022 12 (5)

Grey correlation cases and codes

Class and object finalization
随机推荐
How to choose the right server for website data collection?
[learn C and fly] S1E20: two dimensional array
Knowledge supplement: basic usage of redis based on docker
2022 t elevator repair new version test questions and t elevator repair simulation test question bank
Embedded System Development Notes 81: Using Dialog component to design prompt dialog box
[deep learning] (4) decoder mechanism in transformer, complete pytoch code attached
如何看待智慧城市建设中的改变和机遇?
细数软件研发效能的七宗罪
js 图片路径转换base64格式
OSPF notes [dr and bdr]
mysql 函数 变量 存储过程
VR线上展览所具备应用及特色
1. Mobile terminal touch screen event
Custom components in applets
Ten wastes of software research and development: the other side of research and development efficiency
Measurement of quadrature axis and direct axis inductance of three-phase permanent magnet synchronous motor
Concurrent mode of different performance testing tools
Qt development experience tips 226-230
2022 gas examination question bank and online simulation examination
MySQL winter vacation self-study 2022 12 (5)