简体   繁体   中英

How to clear session from database for same user logged into frontend and backend of joomla?

I have a user logged in admin panel(backend) and frontend of the joomla site. I checked the session table in DB and found that a session has been created for that user. I just deleted that row from DB and when I goto admin panel(backend), the user is logged out, which is correct. But when I goto frontend of the site, the user is not logged out. So my question is "Is separate session maintained for frontend and backend for same user?" If it so then why I didn't find the 2 session rows in session table of DB? Is frontend session stored in separate table?

Also is there a way such that when I click on logout button, I logged out from both backend and frontend of the site?

I think this is due to the fact that removing the row from the #__session table does not fully clear the session. When manually logging out, the Session class is called and the session is destroyed, for example:

$session = JFactory::getSession();
$session->destroy();

Doing this also sets the session state to destroyed :

$this->_state = 'destroyed';

So you'll need to use PHP for this rather than removing tables from the database

The front and back ends are two separate and independent applications. So you can be logged into either or both and have separate sessions. It is possible to share a session also but that requires some work. What's odd to me is that you only saw one session in the table. Are you positive? Did you check the client value?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM