同域名下不一样端口 cookie共享冲突问题

play framework的session是基于cookie的 cookie

默认是存放在PLAY_SESSION这个cookie中 session

而当同一个IP或者域名的不一样端口上都部署了play项目,这时候就会引起不可知的session冲突 app

参考一下配置 dom

application.session.cookie=xxx 这样 session默认存放的cookie name就是  xxx_SESSION了,给不一样的项目定义不一样的名字就能避免session冲突了
spa

# Session configuration ci

# ~~~~~~~~~~~~~~~~~~~~~~ # By default, session will be written to the transient PLAY_SESSION cookie. # The cookies are not secured by default, only set it to true # if you're serving your pages through https. application.session.cookie=xxx # application.session.maxAge=1h # application.session.secure=false # Session/Cookie sharing between subdomain # ~~~~~~~~~~~~~~~~~~~~~~ # By default a cookie is only valid for a specific domain. By setting # application.defaultCookieDomain to '.example.com', the cookies # will be valid for all domains ending with '.example.com', ie: # foo.example.com and bar.example.com # application.defaultCookieDomain=.example.com
相关文章
相关标签/搜索