Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Question about Cookie::set()
  • Hello there,

    I have a question about Cookie class.

    If we have set cookie like following.

    Cookie::set('test','abcdef',60 * 60 * 24);

    After that, we change the value of cookie like following.

    Cookie::set('test','EEEEE');

    Then, expiration would be changed? 

    Or, the same expiration?

    Best regards,
  • HarroHarro
    Accepted Answer
    Cookie::set() sets a new cookie, it doesnt check nor care if a cookie with that same name already exists.

    So if you call set() without specifying an expiry, it will use the configured cookie.expiration value in your apps config.php. If not configured, the default is 0 (expire at end of session).

    It is equivalent to calling the php function setcookie().
  • Thanks for your clear explanation.
    Cheers :)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion