<?php
class SessionController extends Phalcon\Mvc\Controller
{
public function loginAction()
{
//检测cookie之前有没被设置过
if ($this->cookies->has('remember-me')) {
//获取cookie
$rememberMe = $this->cookies->get('remember-me');
//获取cookie的值
$value = $rememberMe->getValue();
}
}
public function startAction()
{
$this->cookies->set('remember-me', 'some value', time() + 15 * 86400);
}
}
这个例子设置cookie和获取cookie都不行啊