I'm doing a simple login as follows
def login() {
session.auth = true
redirect(uri: request.getHeader('referer'))
}
<g:form controller="login" action="login">
<input type="password" placeholder="Password" name="password">
<button type="submit">Submit</button>
</g:form>
When submitting the user gets logged in an the session is created but if the page is refreshed authentication is lost (when deployed to tomcat 7).
Now this test seems to fail after page refresh
<g:if test="${session.auth}">
Everything works fine when builing with eclipse but breaks down in tomcat.
Does anyone know how can I fix this? I would prefer not to add additional security plugins to the app. Can it be done with cookies or some other way?
Related issue Grails 2.1.0 app tomcat 7.0.22 Session empty after redirect
*I know that it's not secure in any way, it is a temporary solution to mimic logging.