dongyou1926
2013-02-06 08:52
浏览 13
已采纳

什么是PHP的cookie的默认生命周期? [关闭]

If I have not set any life time in cookies then what is the default life time in cookie?

for e.g

setcookie("cookiename", $value);

图片转代码服务由CSDN问答提供 功能建议

如果我没有在cookie中设置任何生命周期,那么cookie中的默认生命周期是什么时候?

例如

  setcookie(“cookiename”,$ value); 
   
 
  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

5条回答 默认 最新

  • duan20145 2013-02-06 09:03
    已采纳

    When you create a cookie via PHP die Default Value is 0, from the manual:

    If set to 0, or omitted, the cookie will expire at the end of the session 
    (when your browser closes)
    

    Otherwise you can set the cookies lifetime in seconds as the third parameter:

    http://www.php.net/manual/en/function.setcookie.php

    已采纳该答案
    评论
    解决 无用
    打赏 举报
  • douchongbc72264 2013-02-06 08:53

    If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes).

    http://php.net/manual/en/function.setcookie.php

    评论
    解决 无用
    打赏 举报
  • dousu1900 2013-02-06 08:55

    From the documentation:

    expire

    If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes).

    评论
    解决 无用
    打赏 举报
  • douxuanpa8298 2013-02-06 08:56

    cookies with example

    If the parameter is not set, the cookie will expire at the end of the session (when the browser closes)..

    评论
    解决 无用
    打赏 举报
  • dpxkkhu1812 2013-02-06 09:00
    When you create a cookie via PHP Default Value is 0
    
    If set to 0, or omitted, the cookie will expire at end of the session 
    ie when the browser  closes
    
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题