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:

  1. bootstrap.php init()/run()

  2. index.php (not make sense)

  3. 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

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -