当前位置: 代码迷 >> JavaScript >> cookie的有关问题?请大家帮看看,多谢
  详细解决方案

cookie的有关问题?请大家帮看看,多谢

热度:111   发布时间:2012-03-27 13:44:24.0
cookie的问题?请大家帮看看,谢谢!
JScript code

<script src="jquery.js"></script>
<script src="jquery-cookie.js"></script>
$.cookie('userId',msg.userId,{expires:7,path: '/', domain: '51wk.cn', secure: true});

/*问题:我绑定的域名:http://c2.51wk.cn/ 好像 我 alert($.cookie("userId")); 
浏览器显示null,为何,请大家给我解答。多谢!*/



------解决方案--------------------
JScript code

var expires = new Date();                
                expires.setTime(expires.getTime()); 
$.cookie('userId',msg.userId,{expires:expires.toGMTString(),path: '/', domain: '51wk.cn', secure: true}); 
  相关解决方案