Prevent Session from being created In some cases

Posted by Jean Barmash on Stack Overflow See other posts from Stack Overflow or by Jean Barmash
Published on 2010-05-24T22:05:19Z Indexed on 2010/05/24 22:11 UTC
Read the original article Hit count: 215

Filed under:
|

In my app, I have an external monitor that pings the app ever few minutes and measures its uptime / response time Every time the monitor connects, a new server session is created, so when I look at the number of sessions, it's always a minimum of 15, even during times where there are no actual users.

I tried to address this with putting the session creation code into a filter, but that doesn't seem to do it - I guess session automatically gets created when the user opens the first page?

all() { before = { if (actionName=='signin') { def session = request.session //creates session if not exists } } }

I can configure the monitor to pass in a paramter if I need to (i.e. http://servername.com/?nosession, but not sure how to make sure the session isn't created.

© Stack Overflow or respective owner

Related posts about grails

Related posts about session-variables