function SetCookie(name,value)
{
var argv=SetCookie.arguments;
var argc=SetCookie.arguments.length;
var expires=(2<argc)?argv[2]:null;
var path=(3<argc)?argv[3]:null;
var domain=(4<argc)?argv[4]:null;
var secure=(5<argc)?argv[5]:false;
document.cookie=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"");
}
为什么cookie的最后一个属性secure没有赋值true,请高手指点,万分感谢,另外,菜鸟怎么样才能赚到分
{
var argv=SetCookie.arguments;
var argc=SetCookie.arguments.length;
var expires=(2<argc)?argv[2]:null;
var path=(3<argc)?argv[3]:null;
var domain=(4<argc)?argv[4]:null;
var secure=(5<argc)?argv[5]:false;
document.cookie=name+"="+escape(value)+((expires==null)?"":("; expires="+expires.toGMTString()))+((path==null)?"":("; path="+path))+((domain==null)?"":("; domain="+domain))+((secure==true)?"; secure":"");
}
为什么cookie的最后一个属性secure没有赋值true,请高手指点,万分感谢,另外,菜鸟怎么样才能赚到分
解决方案 »
- 这样函数调用,该如何解释?
- YUI 求解
- input file重复选择同一文件时onchange(IE不执行问题)
- 如何在DIV框加一个关闭按钮??
- ●已解决的层遮住控件的解决代码,但想以参数形式,请指点?
- 各位老师,请问如何对一个IP的合法性和身份证号的合法性进行判断?在线等待,谢谢了!
- 如何让函数自动执行?
- fason高手的“向setTimeout传递函数参数 ”的学习
- 在windows update中点击"添加更新组件"后,会有一个动画的矩形曲线从添加按钮飞到组件列表上,如何实现呢?
- 怎么今天(2004-10-23)的日期,用alert显示为1971?
- js效果的页面,在WIN SERVER2003中无效?
- 在Firefox中怎样实现在IE中的滤镜效果?
Secure
OPTIONAL. The Secure attribute (with no value) directs the user
agent to use only (unspecified) secure means to contact the origin
server whenever it sends back this cookie, to protect the
confidentially and authenticity of the information in the cookie.写明不需要值,也就是只要secure(或者就不写)就可以了,不需要 secure=xxx
path=path; Setting a path for the cookie allows the current document to share cookie information with other pages within the same domain—that is, if the path is set to /thispathname, all pages in /thispathname and all pages in subfolders of /thispathname can access the same cookie information.
secure; Setting a cookie as secure; means the stored cookie information can be accessed only from a secure environment.