这篇文章不说服务端如何保存验证session,单说浏览器端。

前置知识

返回头中的set-cookie

浏览器会自动把返回头的set-cookie项中的值设置到cookie中。

请求头中的cookie

浏览器会自动把cookie中的值设置到每个请求请求头的cookie项中。(所以尽量不要使用cookie,会增大每一次的请求)

浏览器session登录原理

在登录请求中,返回头需要带一个set-cookie项,而set-cookie中有一项是session。这样就把session保存到浏览器的cookie中了。

在请求时cookie被添加到请求头中,即session被包含到请求头的cookie项中。服务端接收到后再验证这个session是否合法。

分类: 其他

12 条评论

g on · 2020年6月20日 下午3:51

Hi there, yup this post is really fastidious and I have learned lot of things from it about
blogging. thanks.

g some · 2020年6月21日 上午6:46

What a stuff of un-ambiguity and preserveness of valuable experience concerning unpredicted feelings.

g but · 2020年6月21日 下午10:30

Great article.

www.nyedupia.net · 2020年6月26日 下午12:20

I am truly thankful to the owner of this web site who has shared
this fantastic article at here.

http://tinyurl.com/ybbv5tav · 2020年6月26日 下午7:50

I am no longer positive where you’re getting your info, but
great topic. I needs to spend a while finding out
much more or understanding more. Thank you for fantastic info I used to be
on the lookout for this information for my mission.

https://www.helios-ps.com/ · 2020年6月26日 下午10:51

Having read this I thought it was rather enlightening.
I appreciate you spending some time and effort to put this information together.
I once again find myself spending a lot of time both
reading and posting comments. But so what, it was still worth it!

anthinhminerals.vn · 2020年6月27日 上午9:53

Good day! I know this is somewhat off topic but I was wondering which blog platform are you using
for this site? I’m getting sick and tired of WordPress because
I’ve had issues with hackers and I’m looking at options for another platform.
I would be awesome if you could point me in the direction of a good platform.

cbd oil that works 2020 · 2020年6月27日 下午11:40

I have to thank you for the efforts you’ve put in penning this website.
I’m hoping to view the same high-grade blog posts
from you later on as well. In truth, your creative writing
abilities has motivated me to get my very own blog now 😉

cbd oil that works 2020 · 2020年6月28日 上午1:24

Hi, yes this post is truly fastidious and I have learned lot of things from it on the topic of blogging.
thanks.

cbd oil that works 2020 · 2020年6月28日 上午3:33

Hi! Do you know if they make any plugins to assist with Search Engine
Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good results.
If you know of any please share. Thank you!

cbd oil that works 2020 · 2020年6月29日 下午12:06

Hello everyone, it’s my first go to see at this web site, and article is truly fruitful for me, keep up posting such content.

cbd oil that works 2020 · 2020年6月29日 下午12:07

Hello, after reading this awesome paragraph
i am too delighted to share my know-how here with friends.

发表评论

电子邮件地址不会被公开。 必填项已用*标注