Where create cookie that holds only user id in Zend MVC project? -
i working zend mvc project. mission: add cookie have user unique id.
problem:i don't know create cookie.
options place create cookie, thing about:
bootstrap.php init()/run()
index.php (not make sense)
in controllers
my project structure:
application/bootstrap.php
public/index.php
please me, if can give example great.
thanks, yosef
i've put in bootstrup.php, created new method called _inituseruniqueid:
protected function _inituseruniqueid(){ $uniq = uniqid(); if(!isset($_cookie['f_uniq'])){ setcookie('f_uniq', $uniq, time() + 60 * 60 * 24 * 365, '/'); } }
Comments
Post a Comment