[英]Redis share session with two different web application
I have set up two web applications. 我已经设置了两个Web应用程序。 they both using spring boot and spring security. 他们都使用弹簧靴和弹簧安全。 these two applications connected to the same redis server. 这两个应用程序连接到同一台redis服务器。
The first application is used for login with google OAuth. 第一个应用程序用于登录google OAuth。 The second application is used for business operation. 第二个应用程序用于业务操作。
These two applications have the same domains but different sub domain. 这两个应用程序具有相同的域但不同的子域。
My purpose is login through the application 1 and store the session in redis then across application 2 by check the session in redis is exist or not. 我的目的是通过应用程序1登录并通过redis将会话存储在应用程序2中,方法是检查redis中的会话是否存在。
Is Redis support to share the session between two different we b application? Redis是否支持在两个不同的应用程序之间共享会话? If not, any other methods so that i can achieve my goal? 如果没有,任何其他方法,以便我可以实现我的目标?
thanks. 谢谢。
You can use multi web applications connect to Redis server, and write or read data. 您可以使用多Web应用程序连接到Redis服务器,以及写入或读取数据。 So yo can share the session between two different web application. 所以你可以在两个不同的Web应用程序之间共享会话。
But I recommended, each Redis should only connected by one Application, and the application can offer many apis for other apps who want to get data. 但我建议,每个Redis应该只通过一个应用程序连接,并且该应用程序可以为其他想要获取数据的应用程序提供许多api。
You can do it easily with help of "spring session". 您可以在“春季会议”的帮助下轻松完成。 The idea is to configure web application to store session outside server and share it with other application. 我们的想法是将Web应用程序配置为在服务器外部存储会话并与其他应用程序共享。 It supports redis out of the box. 它支持redis开箱即用。 Read here for more information, 在此阅读更多信息,
https://docs.spring.io/spring-session/docs/current/reference/html5/guides/boot-redis.html#boot-how https://docs.spring.io/spring-session/docs/current/reference/html5/guides/boot-redis.html#boot-how
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.