开发者

Maintain session in grails

How to maintain session in my grails application. Here is my requirement.

  1. I have to generate session id (in server side) based on the user-name (which comes from client side while log-in).
  2. After log-in, the server should pass the session id to client and sets timer to validate the session.
  3. Fo开发者_如何学Cr every request, the client should pass the session id to server, so that the server is able to check whether the session is alive or not based on the timer.
  4. If the session is valid, the server should process the request and has to increment the timer.
  5. If the session in invalid, the request should not be processed by server.

Please let me know if you any idea/tutorial/suggestions.

Thanks in advance...


This looks exactly how the http session behaves, so you have that functionality out of the box. Just use the session variable to access session attributes. (see here). And this question tells you about how to configure the timeout.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜