It's quite complex to explain it to you, it's easier to ask "How can I do that ...?"
I find it very well resolved, but it is not easy to explain it.
OW::getUser()->isAuthenticated();
example
if( OW::getUser()->isAuthenticated() )
{
//they are logged in
}
I understand that what you want to know is how isAuthenticated () works
But it does not tell us why you want to modify that if it works very well and is quite complicated, and it is also very entertaining to check that it works well if you modify it.
How many users are we talking about when it slows down?
Also be sure that you dont have dev mode enabled or both dev mode and debug mode at the same time.
Also be sure your cron is running every minute. If you are on a host that does not let you use one minute for cron and uses 5 min then that will slow the site down as well as the cron has to do more when it is allowed to run.
Session and cookie code is in ow_core/session.php
And more specifically the login cookie is in ow_system_plugins/base/bol/login_cookie.php and ow_system_plugins/base/controllers/user.php
Are you using any third party plugin which has anything to do with login, caching, or mobile manipulation?
I would first look at plugins to see if any of them are causing this. Test the speed of desktop vrs mobile for logged in users.
But remember that oxwall was never designed for HIGH user volumn, it was designed for low to medium volumn. Those that get hundreds of users logging on all the time will have to do some mod work to the core to get it to run better.
Someone awhile back, years and years ago had done some testing and i could be wrong but if i remember correctly the performance break was somewhere between 50 and 80 users logged on at one time. Now that was active users, not just users sitting, it was users posting pics and videos and topics. I am sure if many of those are just sitting then the number would rise.
I also do not know what oxwall has done since that test, that was many versions ago and im not sure what mods they had done since then if any to improve that.