子域Cookie安全 [英] Sub domain cookie security

查看:74
本文介绍了子域Cookie安全的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里很简单的问题。了解跨域Cookie的安全性,是否同样适用于子域?

Very simple question here. Knowing about cross domain cookie security, does the same apply to sub domains?

EG。我应该能够从www.abc123.com的子域中读取some.abc123.com上设置的cookie吗?

EG. Should I be able to read a cookie set on some.abc123.com from the sub domain of www.abc123.com?

推荐答案

Cookie域是后缀匹配的,因此 www.abc123.com 的cookie不会在 some.abc123.com ,反之亦然。

Cookie domains are suffix matching, so cookies of www.abc123.com will not be sent on the site of some.abc123.com and visa versa.

要在两个域上发送Cookie,您应该使用 .abc123.com 作为域。

To have cookies be sent on both domains you should use .abc123.com as the domain.

这篇关于子域Cookie安全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆