JavaScript网域从子网域读取Cookie [英] JavaScript domain read cookie from subdomain

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

问题描述

我有一个简单的问题 - 是否有任何方法通过JavaScript读取主域上的子域cookie?
例如:我在子域yeah.something.com中设置值为'2'的cookie'hello',然后我想在something.com上读取它。
我试图找到答案,但我发现只有信息如何通过在域上创建子域设置cookie。

I have a simple question - is there any way to read subdomain cookie on main domain by JavaScript? For example: I set cookie 'hello' with value '2' in subdomain yeah.something.com and after that I want to read it on something.com. I tried to find answer for that but I found only information how to set cookie on subdomain by creating it on domain.

推荐答案

请参阅从子网域读取JavaScript Cookie

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

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