doushantun0614 2012-07-22 11:41
浏览 19

agavi设置cookie

I don't know anything about agavi and there might be a lot of error in this..

I want to set up a cookie:

$this->getResponse()->setCookie( ID, 'ID=2342&ClickBannerID=634&SubID=&ClickDateTime=' + time(), mixed $lifetime = time() * 2, string $path = '/', string $domain = 'mydomain', bool $secure = null)


I get: Parse error: syntax error, unexpected T_VARIABLE

it's form: http://www.agavi.org/apidocs/index.html what am I doing wrong

  • 写回答

2条回答 默认 最新

  • duangeli1334 2012-07-22 11:46
    关注

    you mixed function declaration with its run

    $this->getResponse()->setCookie( 'your-cookie-id','ID=2342&ClickBannerID=634&SubID=&ClickDateTime=' . time(),  time() * 2,  '/',  
    'mydomain', null)
    

    and as OcuS stated in comment - probably hire a PHP developer

    评论

报告相同问题?