简体   繁体   English

如何访问CKAN扩展中的会话对象?

[英]How can I access session object in CKAN extension?

I am writing an CKAN extension, where I am implementing CKAN interface IAuthenticator and I need to save some additional information about logged-in user in session. 我正在编写CKAN扩展,在其中实现CKAN接口IAuthenticator,并且需要在会话中保存一些有关登录用户的信息。 I have found out that CKAN uses beaker session. 我发现CKAN使用烧杯会话。 How can I access it? 我该如何访问? In the documentation of CKAN is just one sentence: The Session object is available through the toolkit. 在CKAN的文档中只有一句话: Session对象可通过工具包获得。

Can you help me please? 你能帮我吗?

The session is available as a variable to templates, but it doesn't contain much information - just some info about the User's session cookie. 会话可作为模板的变量使用,但它包含的信息不多-仅包含有关用户会话cookie的一些信息。 The cookie itself just contains an auth token. Cookie本身仅包含一个身份验证令牌。

http://docs.ckan.org/en/latest/theming/variables-and-functions.html#session http://docs.ckan.org/en/latest/theming/variables-and-functions.html#session

What are you trying to do - what info about the user do you need and where are you trying to access it? 您要做什么-您需要有关该用户的哪些信息以及要在何处访问它?

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

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