Another option is to patch sessionCookieConfig off of the servletContext in BootStrap:
class BootStrap {
def init = { servletContext ->
servletContext.sessionCookieConfig.secure = true
}
}
Note: The option causes grails 2.2.4 integration tests to fail with an AbstractMethodError.
Error Error executing script TestApp: org.springframework.mock.web.MockServletContext.getSessionCookieConfig()Ljavax/servlet/SessionCookieConfig;
java.lang.AbstractMethodError: org.springframework.mock.web.MockServletContext.getSessionCookieConfig()Ljavax/servlet/SessionCookieConfig;
at BootStrap$_closure1.doCall(BootStrap.groovy:44)
at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:308)
...