grails session creation, on how to prevent it

天涯浪子 提交于 2020-01-30 11:33:28

问题


in the last line in the following bug report

https://github.com/grails/grails-core/issues/5296

it is stated that;

In an ideal world, it would be possible to turn off HttpSession creation for a whole Controller (all actions) and also turn them off for a particular set of actions.

This is however, a quite old bugreport, so my question is:

is this possible in an upcoming or todays version (1.3.7) of grails? If not, shouldn't it be?

The reason i seek this kind of behavior is due to development of RESTful API's in grails, where the very nature of REST is stateless.


回答1:


Grails does not create a session if you do not access the implicit session object or use session-scoped services. We have multiple projects running in production, where we do not use sessions. As long as you don't access those objects, you won't see any sessions (no JSESSIONID cookies being sent with the response).



来源:https://stackoverflow.com/questions/7348731/grails-session-creation-on-how-to-prevent-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!