当前位置:网站首页>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.
边栏推荐
- Sitescms v3.1.0 release, launch wechat applet
- Quick learning 1.8 front and rear interfaces
- 对业务的一些思考
- Mysqlbetween implementation selects the data range between two values
- Sword finger offer 12 Path in matrix
- [ArcGIS user defined script tool] vector file generates expanded rectangular face elements
- [combinatorics] permutation and combination (multiple set permutation | multiple set full permutation | multiple set incomplete permutation all elements have a repetition greater than the permutation
- The upward and downward transformation of polymorphism
- SSH login server sends a reminder
- Export the entire Oracle Database
猜你喜欢
![[combinatorics] permutation and combination (the combination number of multiple sets | the repetition of all elements is greater than the combination number | the derivation of the combination number](/img/9d/6118b699c0d90810638f9b08d4f80a.jpg)
[combinatorics] permutation and combination (the combination number of multiple sets | the repetition of all elements is greater than the combination number | the derivation of the combination number

Application of ncnn neural network computing framework in orange school orangepi 3 lts development board

Grid connection - Analysis of low voltage ride through and island coexistence

Seven habits of highly effective people

Differences between initial, inherit, unset, revert and all

Image component in ETS development mode of openharmony application development

Xctf mobile--rememberother problem solving

Xctf mobile--app1 problem solving

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

Idea full text search shortcut ctr+shift+f failure problem
随机推荐
How to stand out quickly when you are new to the workplace?
Sword finger offer 17 Print from 1 to the maximum n digits
剑指 Offer 11. 旋转数组的最小数字
Four problems and isolation level of MySQL concurrency
[data mining review questions]
2022-02-11 practice of using freetsdb to build an influxdb cluster
C graphical tutorial (Fourth Edition)_ Chapter 20 asynchronous programming: examples - cases without asynchronous
Sword finger offer 12 Path in matrix
ORM use of node -serialize
Leetcode234 palindrome linked list
Harmonic current detection based on synchronous coordinate transformation
Xctf mobile--app1 problem solving
【习题七】【数据库原理】
【Colab】【使用外部数据的7种方法】
Cache penetration and bloom filter
Sword finger offer 11 Rotate the minimum number of the array
Gan totem column bridgeless boost PFC (single phase) seven PFC duty cycle feedforward
mysqlbetween实现选取介于两个值之间的数据范围
Sword finger offer 15 Number of 1 in binary
Low code platform international multilingual (I18N) technical solution