class UserController {
def logout() {
log.info "User agent: " + request.getHeader("User-Agent")
session.invalidate()
redirect(action: "login")
}
def login() {}
}
session
Purpose
The session object is an instance of the Servlet API’s {jakartaee}jakarta/servlet/http/HttpSession.html[HttpSession] class.
Examples
Description
The {jakartaee}jakarta/servlet/http/HttpSession.html[HttpSession] class is useful for associated session data with a client.
The additional methods added to the session object are documented in the Grails Servlet API reference guide |