当前位置:网站首页>The difference between session and cookie
The difference between session and cookie
2022-07-03 13:05:00 【Ramien】
Preface
In school , Students need a student ID to enter the school ( If it is the first time to enter school , Will give you a student card , That is, it will create a cookie), The student ID here is equivalent to a cookie, Of course ,cookie There can be multiple , Security staff ( The server ) See you have a student ID , You are allowed to enter the school .
If you don't want to pass the student ID these things (cookie) To get into school , You can register information (session), The security guard will record you ( There will be one. sessionID, The only user ), In this way, if you want to enter the school in the future, you can pass the registration information (sessionID) To get into school .
Common ground
cookie and session Are used to identify the conversation mode of browser users .
( conversation : You open a browser , Click on multiple hyperlinks , The whole process from closing the browser can be called a session )
difference
- cookie The data is saved on the client side ,session Data is saved on the server side .
- cookie The action time of can be called setMaxAge Method to set the validity period , Even if the session is closed, it is still valid .session The function time of is that the session ends when it is closed .
- cookie Not very safe , Can analyze the data stored locally COOKIE And carry on COOKIE cheating , If the main consideration is to save important information , Should be used session.
- because session It will remain until the session ends , So when there are a lot of visits , Will affect performance , If you consider reducing server performance , Should be used cookie.
边栏推荐
- Kotlin - improved decorator mode
- Sword finger offer 16 Integer power of numeric value
- The foreground uses RSA asymmetric security to encrypt user information
- Powerful avatar making artifact wechat applet
- 电压环对 PFC 系统性能影响分析
- Image component in ETS development mode of openharmony application development
- The latest version of lottery blind box operation version
- initial、inherit、unset、revert和all的区别
- Slf4j log facade
- An example of newtonjason
猜你喜欢

GaN图腾柱无桥 Boost PFC(单相)七-PFC占空比前馈

【Colab】【使用外部数据的7种方法】

ncnn神經網絡計算框架在香柳丁派OrangePi 3 LTS開發板中的使用介紹

Quick learning 1.8 front and rear interfaces

Sword finger offer 12 Path in matrix

Detailed explanation of the most complete constraintlayout in history

Xctf mobile--rememberother problem solving

有限状态机FSM

Seven second order ladrc-pll structure design of active disturbance rejection controller

How to convert a decimal number to binary in swift
随机推荐
[Exercice 5] [principe de la base de données]
【数据库原理及应用教程(第4版|微课版)陈志泊】【SQLServer2012综合练习】
Grid connection - Analysis of low voltage ride through and island coexistence
Sitescms v3.1.0 release, launch wechat applet
context. Getexternalfilesdir() is compared with the returned path
【数据库原理及应用教程(第4版|微课版)陈志泊】【第六章习题】
基于Linu开发的项目视频
Xctf mobile--app1 problem solving
An example of newtonjason
高效能人士的七个习惯
Mysqlbetween implementation selects the data range between two values
2022-01-27 redis cluster technology research
[problem exploration and solution of one or more filters or listeners failing to start]
SLF4J 日志门面
Kotlin - improved decorator mode
对业务的一些思考
(latest version) WiFi distribution multi format + installation framework
Xctf mobile--app3 problem solving
Kotlin - 改良装饰者模式
Simple use and precautions of kotlin's array array and set list