Cookie 和子域 [英] Cookies and subdomains

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

问题描述

可以在同一顶级域的两个站点之间共享 cookie 吗?说 www.example.comsecure.example.com ?我们正在研究为非安全内容实现缓存,并且需要将安全内容隔离到另一个域.cookie需要什么参数?我正在使用asp.net

Can a cookie be shared between two sites on the same top level domain? Say www.example.com and secure.example.com ? We are looking into implementing a cache for non-secure content, and need to segregate secure content to another domain. What parameters does the cookie need? I'm using asp.net

推荐答案

是的,你可以.使用:

Response.Cookies("UID").Domain = ".myserver.com"

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

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