2013-01-14 83 views
0

我正在使用Joomla 3.0最新版本,我需要刪除session一旦用戶登錄後,我沒有心情再次用login用戶ID ---因此會話在Joomla檢索$session =& JFactory::getSession();在Joomla中設置會話登錄

任何想法如何設置用戶名,以便他只能在網站上一次logged

回答

2

像這樣嘗試,

$user = JFactory::getUser(); 
$session =& JFactory::getSession(); 

$session->set('userid',$user->id); 

//checking whether the user logged in or not 
$userid = $session->get('userid'); 
if($userid=='') 
{ 
    $session->set('userid',''); //set to blank 
}