日期:2014-05-16  浏览次数:20486 次

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});