session not shared between two server

六眼飞鱼酱① 提交于 2020-01-01 06:26:11

问题


i have big trouble with my application that web-application(jsp,java,servlet) landed between two server cause there 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.......


回答1:


You have two options:

  • sticky session - once some user hits one server, load balancer makes sure she will always use the exact same server.

  • 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.



来源:https://stackoverflow.com/questions/12598919/session-not-shared-between-two-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!