Exemplo n.º 1
0
 function getToken()
 {
     srand((double) microtime() * 1000000);
     $token = md5(uniqid(rand()));
     $phraseObj = new Phrase();
     $phraseObj->setStringLengthRange(5, 7);
     $validateKey = $phraseObj->getPhrase();
     $timestamp = time();
     $this->db->query("INSERT INTO {$this->table['cap']} SET session_id='{$token}', validate_key='{$validateKey}', timestamp='{$timestamp}'");
     return $token;
 }