如果页面没有重新加载,javascript cookie无法正常工作

时间:2018-04-17 18:07:01

标签: javascript

**javascript cookies not working in firefox suppose**
<script>

的document.cookie =&#34;语言= JavaScript的&#34 ;;

**this is working in single tab fine in firefox but if i open multiple tab 
after that if i changed any values of cookies it will not getting current 
changed values** 

**suppose from developer console if i change cookies like this**

的document.cookie =&#34;语言= PHP&#34 ;;

**then go to another tab then but not reload and  print it will not print** 
"Language=PHP"
**its printing "Language=javascript"**


<script>

1 个答案:

答案 0 :(得分:-1)

我总是从w3c学校设置Cookie和getCookie功能。 它适用于所有浏览器。 试试吧。 这里 https://www.w3schools.com/js/js_cookies.asp