MyBB Community Forums

Full Version: Never Log out of ACP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As you know, when your logged into MyBB's ACP your logged out after a certain period of inactivity. So I just need someone to tell me how to make it so that my session never expires, also this is on my localhost so I'm not worried about security issues. Thanks!
I think this requires some root modifications, since I believe it's coded to log you out after an hour or so. You probably would need to change the timer from 60 to another larger number. Question is, where would you change it.?
Line 249 of ./admin/index.php, find and remove:

// Admin CP sessions 2 hours old are expired
if($admin_session['lastactive'] < TIME_NOW-7200)
{
	$login_message = $lang->error_admin_session_expired;
	$db->delete_query("adminsessions", "sid='".$db->escape_string($mybb->cookies['adminsid'])."'");
	unset($mybb->user);
}
// If IP matching is set - check IP address against the session IP
else 

Make sure you remove the else at the end, it's to change the 'else if' on line 256 to just an 'if'.
Okay now I'm getting this error:

Parse error: parse error in C:\wamp\www\mybb\admin\index.php on line 276

Are you sure you only removed what's there?? It works perfectly fine for me when I make that edit.
I removed what you told me and I still get the error.

Edit: Nvm I forgot to change "else if" to just "if".
I did purposely mention that specific bit in my post, but glad it's working.