【发布时间】:2020-12-13 23:05:11
【问题描述】:
我在我的一个流媒体项目中使用 Ant Media Server。我需要在 Ant Media Server 中设置SameSite=none。你能告诉我怎么做吗?
【问题讨论】:
标签: webrtc streaming ant-media-server
我在我的一个流媒体项目中使用 Ant Media Server。我需要在 Ant Media Server 中设置SameSite=none。你能告诉我怎么做吗?
【问题讨论】:
标签: webrtc streaming ant-media-server
您需要通过context.xml 设置SameSite 属性。默认情况下,context.xml 文件在/usr/local/antmedia/webapps/{APP}/META-INF/context.xml 下
添加以下行以将SameSite 设置为none:
<CookieProcessor sameSiteCookies="none" className="org.apache.tomcat.util.http.Rfc6265CookieProcessor"/>
那么你的context.xml 文件应该是这样的:
<Context>
<Resources allowLinking="true" cacheTtl="500" className="io.antmedia.webresource.StreamWebRoot"/>
<CookieProcessor sameSiteCookies="none" className="org.apache.tomcat.util.http.Rfc6265CookieProcessor"/>
</Context>
请注意SameSite=none 可用于访问安全内容。也就是说,你需要使用HTTPS。
其他SameSite值,请访问https://tomcat.apache.org/tomcat-8.5-doc/config/cookie-processor.html
要了解有关SameSite 属性的更多信息,请访问以下链接
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite
【讨论】: