O'Reilly logo

Spring Security 3 by Peter Mularien

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Moving remember me to the database

Something that you may have noticed by now, with our remember me implementation, is that it works very well until the application server is restarted, at which point the user's session is forgotten. This could be inconvenient for our users, who shouldn't have to pay attention to the maintenance and ups and downs of JBCP Pets.

Fortunately, Spring Security provides the capability to persist rememberme tokens any store implementing the o.s.s.web.authentication.rememberme.PersistentTokenRepository interface, and ships with a JDBC implementation of this interface.

Configuring database-resident remember me tokens

Modifying our remember me configuration at this point to persist to the database is surprisingly trivial. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required