什么是服务器在cookie少的会话中的角色? [英] Whats the Role of a server in a cookies less session?

查看:51
本文介绍了什么是服务器在cookie少的会话中的角色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我主持无cookie会话时,服务器如何从文件中读取信息?

在哪个文件夹中创建的文件包含会话信息?

假设我正在制作第一个请求和关闭会话,我现在正在发出第二个请求,服务器如何知道请求的来源?

When i host a cookieless session, how does server read information from the file?
In which folder are the files created containing session information?
Assume I am making a first request and closing the session, i am now making second request ,how does the server know from where the request is coming?

推荐答案

首先要了解什么是会议?

会话基本上是将用户级别值存储到服务器上。会话有两个部分,一个是会话ID,第二个是会话值。会话ID以cookie的形式存储在客户端计算机上,会话值存储在服务器端。当我们从客户端机器请求时,它会携带会话ID以及每个请求,因此您的Web服务器知道该请求来自同一客户端,因为服务器具有会话ID和会话值的映射。因此,如果我们再次从同一客户端请求,那么相同的会话ID将转到Web服务器,因此Web服务器能够提供请求。



如果cookie少了会话,会话ID不存储在cookie中。在这种情况下,会话ID附加在URL中,并与请求一起发送到服务器。因此,用户可以在URL中查看会话ID。
First of all understand what is session?
A session is basically to store user level value on to the server. There are two parts of session, one is session id and second is session value. Session ID gets store on to the client machine in the form of cookies and Session value gets store on to the server side. What happens is when we request from a client machine, it carries the session id along with every request and thus your web server knows that request is coming from the same client as the server has the mapping of session id and session value. So if we are requesting again from the same client then same session id goes to web server and thus web server is able to serve the request.

In case of cookie less session, session id doesn't store in the cookies. In this case session id appends in the URL and goes along with request to the server. So user can able to see the session ID in the URL.


这篇关于什么是服务器在cookie少的会话中的角色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆