token token base datebase

  1. Documentation
  2. Change Log

This extension is create and validate token.

Documentation

Requirements
  • Yii 1.0 or above
Installation
  • Extract the release file under protected/components
  • Create table:
      CREATE TABLE IF NOT EXISTS `token` (
        `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
        `action` varchar(100) DEFAULT NULL,
        `identity` char(32) NOT NULL,
        `token` char(32) DEFAULT NULL,
        `data` text,
        `expire_time` int(10) unsigned DEFAULT NULL,
        PRIMARY KEY (`id`)
      );
    
  • Add componets in main.php

    'tokenManager'=>array(

      'class'=>'TokenManager',
    

    ),

Usage

See the following code example: ~~~

  • Create token

      $token = Yii::app()->tokenManager->create('actionName', array('Some Params'), 172800, array('Data saved in this token'));
    
  • Validate token *

      $data = Yii::app()->tokenManager->validate('actionName', $token);
    

Change Log

March 3, 2010
  • Initial release.
    March 6, 2010
  • Add public $secretKey and delete SECRET_KEY
3 0
8 followers
2 033 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Security
Tags:
Developed by: dongbeta
Created on: Mar 3, 2010
Last updated: 14 years ago

Downloads

show all