In my project, there was a requirement to set the session time out interval and i had no idea about how to implement it. Then my colleague Himanshu Seth came to rescue. This guy has already done it. All you have to do is to set the maximum time out interval in the session. Here is the sample code.
declare a SESSION_TIMEOUT constant in your application constants file (AppConstants.groovy).
public static final Integer SESSION_TIMEOUT = 3600 // This time is set in seconds. 3600 = 1 hour
Now set the maximum inactive interval of session. You need to write this line of code in your controller.
Hope it helps.