简体   繁体   中英

InvalidatedSessionException in grails 2.1 with database-session 1.2.0 and spring security core when logging out

I need sessions to be stored in database. I used the database-session plugin from Robert Fischer ( https://github.com/RobertFischer/grails-database-session ) in version 1.2.0 and updated it to grails 2.1. I installed the plugin in my main project and everything works fine except the logout function in spring security core. When i log out via the spring security logout-controller i get the following exception:

URI: /myProject/j_spring_security_logout
Class: grails.plugin.databasesession.InvalidatedSessionException
Message: Session ABD84995E13B9D1AD4DBD228C0E5902C is invalid; cannot access/modify it.

屏幕截图

Maybe you know a solution to fix this?

My environment:

Grails 2.1
Spring Security Core 1.2.7
grails-database-session 1.2.0 by Robert Fischer (see Github)
mySQL-Database is connected (JDBC)

This is a bug in Spring Security Core: it is trying to access an invalidated session, which is a violation of the Servlet spec. But, until they fix that, you can set the config.grails.plugin.databasesession.ignoreinvalid property to true and you won't get an exception.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM