问题描述
我的应用程序遇到很大麻烦,因为Web应用程序(jsp,java,servlet)在两台服务器之间着陆服务器之间存在负载分担,但不幸的是,服务器之间会话现在不维护.我要在登录后检查会话是否存在,否则,我要从url中获取所有凭据(如果有人记得url,则混乱的话,带有相同密钥的可见编码url)显然,它根本不安全,因此,我们如何在应用程序级别解决此问题,请指导我.......
i have big trouble with my application that web-application(jsp,java,servlet) landed between two server causethere is load-sharing between server but unfortunately session not maintaining between server now i am checking checking after login if session is there than ok otherwise i am taking all credential from url (visible encoded url with same key if somebody remember url then big mess ) obviously its not secure at all ,SO how we can resolve this problame at application level please guide me.......
推荐答案
您有两个选择:
-
粘性会话-一旦某些用户点击一台服务器,负载均衡器将确保她将始终使用完全相同的服务器.
sticky session - once some user hits one server, load balancer makes sure she will always use the exact same server.
会话复制-HTTP会话中的每个更改都将迁移到群集中的另一个节点.负载均衡器不受影响.
session replication - every change in HTTP session is migrated to another nodde in the cluster. Load balancer remains unaffected.
这两种方法都只是配置,不需要更改您的应用程序.
Both approaches are configuration only, no changes to your application are required.
这篇关于会话未在两个服务器之间共享的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!