Note that there are some explanatory texts on larger screens.

plurals
  1. POYii sessions timeout in webservice
    text
    copied!<p>I want to change timeout for sessions. I set the timeout 1 second.</p> <p>whenever I sign in to system , I can use the signout service after even a minute, while it's just for logged-in users.</p> <p>Note : I write my own code for sign in and sign out.</p> <p>here is my code for signin and signout service :</p> <pre><code>public function actionSignin() { $model= new Users(); $model-&gt;scenario ="signin"; if(isset($_POST['Users'])) { $model-&gt;attributes=$_POST['Users']; $model-&gt;validate(); if($model-&gt;hasErrors()){ if($model-&gt;hasErrors("username")) $result=array("status"=&gt;$model-&gt;getError("username")); else if($model-&gt;hasErrors("password")) $result=array("status"=&gt;$model-&gt;getError("password")); }else{ $user = $model-&gt;get_user(); $result['user'] = $user; //// creating session $session=new CHttpSession; $session-&gt;open(); $session['name']=$user['username']; $result=array("status"=&gt;ErrorManager::get("OK"); } }else{ $result=array("status"=&gt;ErrorManager::get("no_data_submitted")); } $this-&gt;renderPartial("/print_result",array("result"=&gt;$result,)); } public function actionSignout(){ $session=new CHttpSession; if(isset($session['name'])) { $result = array("status"=&gt;ErrorManager::get("OK")); $session-&gt;destroy(); $this-&gt;renderPartial("/print_result",array("result"=&gt;$result); } } </code></pre> <p>and there is session configuration in my config file (main.php) : </p> <pre><code>'components'=&gt;array( 'session' =&gt; array ( 'class'=&gt;'CHttpSession', 'cookieMode' =&gt; 'allow', 'timeout' =&gt; 1 ), </code></pre> <p>Please tell me What the problem is...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload