Skip to content

amitlt/spring-session-redis-demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Session Redis Demo   Tweet

Build Status

Externalize session information to Redis using Spring projects

  • Spring Data Redis
  • Spring Session
  • Spring Security

What for?

When working on a multi-instance web application, application state must be all externalized from the web servers. Users' session information are by default stored in-memory by the web servers, such as Wildfly or Apache Tomcat.

In order to resolve this matter the architecture demo implemented here stores session information on Redis (follow the link for more information) so when a web server is down others have access to the sessions this server was handling requests from.

See this blog post for further information.

Setup

Before running this demo, make sure you have Redis running. You may either install it or run its Docker image.

Default Redis host and port:

127.0.0.1:6379

Run

  • Clone
  • Run SpringSessionRedisDemoApplication.java

Play

  • Access http://localhost:8080
  • Log in as admin/admin
  • Restart your server
  • Refresh your browser
  • Keep using your session from where you left it

About

Example on how to use Spring Session with Redis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 91.1%
  • HTML 8.9%