简体   繁体   English

Redis与两个不同的Web应用程序共享会话

[英]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.

相关问题 如何在不同Web服务器上的两个Web应用程序中共享会话? - How can I share session in two web application in different web servers? Java - 如何在两个或多个 Web 应用程序之间共享会话? - Java - How to share the session between two or more Web Application? 如何在部署在两个不同的tomcat实例中的两个Web应用程序之间共享会话 - How to share session across two web applications deployed in two different tomcat instances 在Java Web应用程序中共享同一会话 - Share The Same Session in Java Web Application 在Web应用程序的不同用户之间共享对象的正确方法 - Right way to share object between different users of web application Spring - 在不同的webapps之间共享Web应用程序上下文 - Spring - share web application context between different webapps 使用两个不同的Java Web框架时访问http会话 - Access http session when using two different Java Web frameworks 维护应用程序中两个http不同请求之间的会话状态 - Maintaining session state across two http different requests in an application Web应用程序会话缓存 - web application session cache 如果两个Java Web应用程序之间实现了会话共享,会话超时是否会受到影响? - Does session timeout get affected if session sharing is achieved between two java web application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM