memcached-session-manager session共享
大家好:
需求:不同tomcat之間實現session共享。(tomcatA和tomcatB取到同一sessionID)
實現:CentOs5.8 memcached-session-manager 1.8.1 tomcat-6.0.37
步驟:按照http://code.google.com/p/memcached-session-manager/wiki/SetupAndConfiguration
Example for multiple contexts sharing the same session id
If you are running multiple webapps/contexts sharing the same session id (e.g. by having set sessionCookiePath="/" - or emptySessionPath="true" in tomcat 6) you must tell memcached session manager to add a prefix to the session id when storing a session in memcached. For this you can use the storageKeyPrefix attribute as shown by this example (see also the more detailed attribute description below):
<Context sessionCookiePath="/">
...
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:host1.yourdomain.com:11211,n2:host2.yourdomain.com:11211"
failoverNodes="n1"
storageKeyPrefix="context"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"
/>
</Context>
結果訪問不同的tomcat sessionID仍然不一樣,求解。
需求:不同tomcat之間實現session共享。(tomcatA和tomcatB取到同一sessionID)
實現:CentOs5.8 memcached-session-manager 1.8.1 tomcat-6.0.37
步驟:按照http://code.google.com/p/memcached-session-manager/wiki/SetupAndConfiguration
Example for multiple contexts sharing the same session id
If you are running multiple webapps/contexts sharing the same session id (e.g. by having set sessionCookiePath="/" - or emptySessionPath="true" in tomcat 6) you must tell memcached session manager to add a prefix to the session id when storing a session in memcached. For this you can use the storageKeyPrefix attribute as shown by this example (see also the more detailed attribute description below):
<Context sessionCookiePath="/">
...
<Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
memcachedNodes="n1:host1.yourdomain.com:11211,n2:host2.yourdomain.com:11211"
failoverNodes="n1"
storageKeyPrefix="context"
requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory"
/>
</Context>
結果訪問不同的tomcat sessionID仍然不一樣,求解。
相關文章
- session 共享Session
- Session分散式共享 = Session + Redis + NginxSession分散式RedisNginx
- session共享問題???Session
- php跨域共享sessionPHP跨域Session
- Web--Session共享問題WebSession
- nginx+tomcat+session共享NginxTomcatSession
- Tomcat 共享session問題TomcatSession
- 使用Memcached實現Session共享Session
- 多個 Laravel 與 Lumen session 共享LaravelSession
- 通過redis實現session共享RedisSession
- 使用memorycache作為session共享配置Session
- PHP實現多伺服器session共享之memcache共享PHP伺服器Session
- 大叔也說Xamarin~Android篇~為HttpClient共享Session,android與api的session共享機制AndroidHTTPclientSessionAPI
- Spring Session實現Session共享下的坑與建議SpringSession
- spring-session-data-redis共享方案SpringSessionRedis
- Springsession+redis實現session共享SpringGseSessionRedis
- Spring Boot 2 + Redis 處理 Session 共享Spring BootRedisSession
- 快速實現 Tomcat 叢集 Session 共享TomcatSession
- memcache連線php以及實現session共享PHPSession
- PHP多臺伺服器如何共享sessionPHP伺服器Session
- 基於tomcat叢集做session共享TomcatSession
- 設定ear中war之間session共享Session
- SpringBoot2.x 整合Spring-Session實現Session共享Spring BootSession
- 多臺web伺服器之間共享sessionWeb伺服器Session
- 用Nginx實現Session共享的均衡負載NginxSession負載
- 分散式中使用 Redis 實現 Session 共享(上)分散式RedisSession
- 分散式中使用 Redis 實現 Session 共享(中)分散式RedisSession
- 分散式中使用 Redis 實現 Session 共享(下)分散式RedisSession
- Asp.net中多專案共享Session (轉)ASP.NETSession
- 如何在多臺 Web 伺服器上共享 sessionWeb伺服器Session
- 玩轉spring boot——負載均衡與session共享Spring Boot負載Session
- Tomcat利用MSM實現Session共享方案解說TomcatSession
- nginx+iis+redis+Task.MainForm構建分散式架構 之 (redis儲存分散式共享的session及共享session運作流程)NginxRedisAIORM分散式架構Session
- android中HttpClient獲取Session然後使用 WebView共享session的解決辦法(轉)AndroidHTTPclientSessionWebView
- Shiro+Redis實現tomcat叢集session共享RedisTomcatSession
- Nginx搭建Tomcat9叢集並實現Session共享NginxTomcatSession
- 共享池之九:繫結變數與session_cached_cursors變數Session
- Spring Session+Spring Data Redis 解決分散式系統架構中 Session 共享問題SpringSessionRedis分散式架構