zoukankan      html  css  js  c++  java
  • 关于TP,PHP和shopnc 的cookie

    PHP:
    setcookie(name, value, expire, path, domain);//expire 为时间戳


    setcookie("user", "Alex Porter", time()+3600);
    setcookie("user", "", time()-3600);


    TP:封装

    cookie('name','value',3600); // 指定cookie保存时间,不支持负值清空,用null(不是时间戳)
    cookie('name','value',array('expire'=>3600,'prefix'=>'think_'))



    NC:封装 

    setNcCookie( $name, $value, $expire = "3600", $path = "", $domain = "", $secure = FALSE )// 指定cookie保存时间,负值为过期(不

    是时间戳)

    function cookie( $name = "" )
    {
    $name = defined( "COOKIE_PRE" ) ? COOKIE_PRE.$name : strtoupper( substr( md5( MD5_KEY ), 0, 4 ) )."_".$name;
    return $_COOKIE[$name];
    }


  • 相关阅读:
    AUTOSAR-文档阅读
    前端 html
    http协议
    python格式化输出
    IO模型
    协程函数
    伟大的GIL
    苑之歌(进程,线程)
    python之模块导入和包
    任性计算器
  • 原文地址:https://www.cnblogs.com/linewman/p/9918855.html
Copyright © 2011-2022 走看看