当前位置:网站首页>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 algorithm & interview questions, 28 days of special training in large factories - the 13th day (array)
- Offline installation of Wireshark 2.6.10
- Use winmtr software to simply analyze, track and detect network routing
- 2022危险化学品生产单位安全生产管理人员题库及答案
- 2022 hoisting machinery command registration examination and hoisting machinery command examination registration
- [godot] unity's animator is different from Godot's animplayer
- Unity's 3D multi-point arrow navigation
- Grey correlation cases and codes
- Do280 management application deployment --rc
- [leetcode skimming] February summary (updating)
猜你喜欢

"Target detection" + "visual understanding" realizes the understanding of the input image

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

slf4j 简单实现

NFT: start NFT royalty journey with eip-2981

LM小型可编程控制器软件(基于CoDeSys)笔记二十:plc通过驱动器控制步进电机

Possible problems and solutions of using scroll view to implement slider view

2022 Shanghai safety officer C certificate examination question simulation examination question bank and answers

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

MySQL winter vacation self-study 2022 12 (5)

【LeetCode】100. Same tree
随机推荐
selenium打开chrome浏览器时弹出设置页面:Mircrosoft Defender 防病毒要重置您的设置
Some small knowledge points
JMeter learning notes 2 - brief introduction to graphical interface
CUDA development and debugging tool
Dual contractual learning: text classification via label aware data augmentation reading notes
Why is Hong Kong server most suitable for overseas website construction
2022.2.7-2.13 AI industry weekly (issue 84): family responsibilities
Unity's 3D multi-point arrow navigation
Question bank and online simulation examination for special operation certificate of G1 industrial boiler stoker in 2022
MySQL winter vacation self-study 2022 12 (5)
VR线上展览所具备应用及特色
Embedded System Development Notes 79: why should I get the IP address of the local network card
[pat (basic level) practice] - [simple simulation] 1064 friends
使用WinMTR软件简单分析跟踪检测网络路由情况
Odeint and GPU
Maixll dock quick start
扩展-Fragment
TCP server communication flow
NFT: start NFT royalty journey with eip-2981
嵌入式系统开发笔记80:应用Qt Designer进行主界面设计