Example #1
0
 /**
  * The constructor loads the anonymous_id from kohana config or gens a new
  * one if necessary.  It also loads the cache object into the class member $cache.
  *
  * @return void
  */
 public function __construct()
 {
     self::$cache = Cache::instance();
     $anonymous_id = Kohana::config('core.anonymous_id');
     if (empty($anonymous_id)) {
         $anonymous_id = strtoupper(md5(uniqid(rand(), true)));
     }
     self::$anonymous_id = $anonymous_id;
 }