We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

why phalcon cannot reset cookies

this is my code, set cookie and reset cookie use it,but when call it ,its just database data changes?help me !!

public function rememberMe(UserUsers $user){
        $salt = 'GYHZMFSWP';
        $identifier = md5($salt . md5($user->name . $salt));
        $permanent  = md5(uniqid(rand(), TRUE));

        $this->cookies->set('permanent',$permanent, time() + 15 * 86400);
        $this->cookies->set('identifier',$identifier, time() + 15 * 86400);

        $usery = UserUsers::findFirst( array("id = '".$user->id."'") );
        $usery->identifier = $identifier;
        $usery->permanent  = $permanent;
        $usery->save();
    }


718
Accepted
answer
edited Apr '15

Hi,

rememberMe is a controller action? You need to send cookies to client/browser.

Are you sure browser accept cookies from your backend/server/domain?



27.0k