简体   繁体   English

沙洲会话如何运作?

[英]How do sandbar sessions work?

I'm supposed to use sandbar for a Clojure web application. 我应该将沙洲用于Clojure Web应用程序。 I am wondering how sandbar maintains sessions on the server side? 我想知道沙洲如何维护服务器端的会话? Does it us jsessionid cookies to identify user request? 我们使用jsessionid cookie来识别用户请求吗? Or is sandbar just sending the session object back to the client, re-reading it from the request, manipulating the session and re-sending it back? 或者是沙洲只是将会话对象发送回客户端,从请求中重新读取它,操纵会话并重新发送回来?

sandbar sessions use the same storage backends that ring sessions use, and wrap-stateful-session supports the same options that ring's wrap-session uses. 沙洲会话使用与会话使用相同的存储后端,并且wrap-stateful-session支持ring的wrap-session使用的相同选项。 So you can use any session key you like (it's not jsessionid by default) and your preferred store. 所以你可以使用你喜欢的任何会话密钥(默认情况下不是jsessionid )和你喜欢的商店。 The default is an in-memory store. 默认值为内存存储。

Each user gets a unique session ID, and that's all that's sent to the user in a cookie. 每个用户都获得一个唯一的会话ID,这就是用cookie发送给用户的所有内容。 Server-side, there's a mutable object mapping session IDs to objects - sandbar updates and reads from this based on the current session ID. 在服务器端,有一个可变对象将会话ID映射到对象 - 沙洲更新并根据当前会话ID从中读取。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM