码迷,mamicode.com
首页 > Windows程序 > 详细

Cookie API

时间:2016-07-05 12:15:27      阅读:262      评论:0      收藏:0      [点我收藏+]

标签:

Cookie API

All cookies created by the Nova framework are encrypted and signed with an authentication code, meaning they will be considered invalid if they have been changed by the client.

Retrieving A Cookie Value

$value = Cookie::get(‘name‘);

Attaching A New Cookie To A Response

$response = Response::make(‘Hello World‘);

$response->withCookie(Cookie::make(‘name‘, ‘value‘, $minutes));

Queueing A Cookie For The Next Response

If you would like to set a cookie before a response has been created, use the Cookie::queue() method. The cookie will automatically be attached to the final response from your application.

Cookie::queue($name, $value, $minutes);

Creating A Cookie That Lasts Forever

$cookie = Cookie::forever(‘name‘, ‘value‘);

Forgetting A Cookie

Cookie::forget(‘name‘);

Cookie API

标签:

原文地址:http://www.cnblogs.com/chunguang/p/5642972.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!