Yii Control Time Between Tow Actions

Hi every one, sorry for my englich :)

I have tow actions: index and load.

in my view i have a javascript time (5 second) to activate button that call load action, I still want to strengthen security by also testing time between tow action index—>load.

How can i do that ? i know that existe Yii::app()->cache->set($id, $value); but this is shared for all user.

You could store the time in the user’s session:




Yii::app()->user->setState('indexTime', $time);

...

Yii::app()->user->getState('indexTime');



thanks Keith for your response.

is this work when user is ghost ? if i have two simultaneously user in my site how this work ?

If the user is a guest, they’ll still have a separate session from other guests.

thanks :)