# cookie **Repository Path**: iuk-ink/cookie ## Basic Information - **Project Name**: cookie - **Description**: 一个简单的Cookie操作类 - **Primary Language**: PHP - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-01-14 - **Last Updated**: 2023-01-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # cookie ### 一个很简单的Cookie操作类 ## 使用方法 在你的项目下执行Composer: ``` composer require wispx/cookie ``` ```php '', // 过期时间 'expire' => 0, // 保存路径 'path' => '/', // 有效域名 'domain' => '', // 是否启用安全传输 'secure' => false, // 是否设置httponly 'httponly' => false, // 是否使用setCookie 'setcookie' => true ]); */ // 判断Cookie是否已经被设置 [string $name, string $prefix = null] $cookie->has('test'); // 设置Cookie [string $name, string $value, string $prefix = null] $cookie->set('test', 123456); // 获取Cookie [string $name, string $prefix = null] $cookie->get('test'); // 永久保存Cookie [string $name, string $value = '', string $prefix = ''] $cookie->forever('test', 123456); // 也可以单独设置Cookie前缀 [$prefix = ''] $cookie->prefix('w_'); // 删除Cookie [string $name, string $prefix = null] $cookie->delete('test'); // 清空Cookie [$prefix = ''] $cookie->clear(); // 也可以这样使用 Cookie::instance()->has('test'); ``` ## License - MIT