phpDocumentor http
cookie
[ class tree: http ] [ index: http ] [ all elements ]

Class: WindCookie

Source Location: /utility/WindCookie.php

Class WindCookie

Class Overview

cookie操作类

使用的时候全部采用静态的方式使用该类中的所有方法:

  1.  Wind::import('WIND:http.cookie.WindCookie');
  2.  WindCookie::set('name''test');

Located in /utility/WindCookie.php [line 18]



		
				Author(s):
		
		
		
Information Tags:
Version:  $Id: WindCookie.php 3230 2011-12-02 09:18:54Z yishuo $
Copyright:  ©2003-2103 phpwind.com
License:  http://www.windframework.com

Methods

[ Top ]
Method Summary
static boolean   delete()   根据cookie的名字删除cookie
static boolean   deleteAll()   移除全部cookie
static boolean   exist()   判断cookie是否存在
static mixed   get()   取得指定名称的cookie值
static boolean   set()   设置cookie

[ Top ]
Methods
static method delete  [line 48]

  static boolean delete( string $name  )

根据cookie的名字删除cookie

Parameters:
string   $name:  cookie名称

API Tags:
Return:  删除成功返回true
Access:  public


[ Top ]
static method deleteAll  [line 77]

  static boolean deleteAll( )

移除全部cookie


API Tags:
Return:  移除成功将返回true
Access:  public


[ Top ]
static method exist  [line 88]

  static boolean exist( string $name  )

判断cookie是否存在

Parameters:
string   $name:  cookie名称

API Tags:
Return:  如果不存在则返回false,否则返回true
Access:  public


[ Top ]
static method get  [line 63]

  static mixed get( string $name, [boolean $dencode = false]  )

取得指定名称的cookie值

Parameters:
string   $name:  cookie名称
boolean   $dencode:  是否对cookie值进行过解码,默认为false即不用解码

API Tags:
Return:  获取成功将返回保存的cookie值,获取失败将返回false
Access:  public


[ Top ]
static method set  [line 33]

  static boolean set( string $name, [string $value = null], [boolean $encode = false], [string|int $expires = null], [string $path = null], [string $domain = null], [boolean $secure = false], [boolean $httponly = false]  )

设置cookie

Parameters:
string   $name:  cookie名称
string   $value:  cookie值,默认为null
boolean   $encode:  是否使用 MIME base64 对数据进行编码,默认是false即不进行编码
string|int   $expires:  过期时间,默认为null即会话cookie,随着会话结束将会销毁
string   $path:  cookie保存的路径,默认为null即采用默认
string   $domain:  cookie所属域,默认为null即不设置
boolean   $secure:  是否安全连接,默认为false即不采用安全链接
boolean   $httponly:  是否可通过客户端脚本访问,默认为false即客户端脚本可以访问cookie

API Tags:
Return:  设置成功返回true,失败返回false
Access:  public


[ Top ]

Documentation generated on Fri, 30 Mar 2012 11:43:30 +0800 by phpDocumentor 1.4.4