We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Isauthenticated function | Forum

Topic location: Forum home » Support » General Questions
Marcus
Marcus May 22 '19
Where can i find how oxwall checks wheather user is logged in or not on each page load?

public function isAuthenticated()
    {
        return $this->authenticator->isAuthenticated();
    }

How exacly this works. Where is the data thay this function checks?
Patricia Zorrilla Leader
Patricia Zorrilla May 22 '19

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. 

Marcus
Marcus May 23 '19
Id like to find out where it checks the cookie and session?
dave Leader
dave May 23 '19
This is what you want for login verify


OW::getUser()->isAuthenticated();


example  


if( OW::getUser()->isAuthenticated() )

{


//they are logged in


}


Patricia Zorrilla Leader
Patricia Zorrilla May 23 '19

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.


Marcus
Marcus May 23 '19
Guy my website is super fast when there in nobody online but when i got bunch of users the site stopps responding. The only plugin i have is mailbox and notificatins. I need to see maybe authification is not working properly sesion or cookie. The wierd thing it only affects logged in users not guests. Is if oxwall tring to check whether user is logged in or online and sowhere there is a bug. P.s mailbox only have messages so its shouldnt be a problem. Plus its a random event. It could be oxwall cache trying to get user id or something from cache that malfunctining. Please point me in the diction of the code that checks users cookie snd compairs that with session.
The Forum post is edited by Marcus May 23 '19
dave Leader
dave May 23 '19
The site could slow down because of server IO limits.  Are you on a shared server, if so they may limit the IO (Input Output) data in some way, many less expensive hosts do this. 


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




The Forum post is edited by dave May 23 '19
Marcus
Marcus May 23 '19
Thanks dave im on business hosting with 2cpus and 4gb of ram. The strange thing is that you have a page viewed by a guess which loads super fast and the same page viewed at the same time by a logged in user simply doest respond. The guests are not affected at all the site is slow on logged in users and stays un affected on guests. Wierd. Its not hosting case it would have affected guests too but its not only users. I see site slowing after only maybe 5 online users. Cron is set to fire every min. 
dave Leader
dave May 23 '19
Are you using cloudflare at all?


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. 

Marcus
Marcus May 24 '19
Thanks Dave. No clauflare on my site. The only plugin i have that does hooks up to login is 2 factor verification but i have it disabled maybe i have to un install it. Once i literally disabled all plugins and nothing. Am running 180 version maybe there is a bug.
dave Leader
dave May 24 '19
let me see what i can discover on my own, ill get back to you on this, im gonna look for some stuff on my test copy. 
Marcus
Marcus May 24 '19
Thanks dave. I dont see too many pics uploaded so people looging in must be viewing profiles or checking messages. Most users showing online are not active. The site is super fast again viewing it from the users prospective not  the guests since they are not affected. Does Oxwall use cache to store user ids? Maybe its not woking properly and some data gets messed up. 

P.s. when the site is slow not responding you wont be able to log in case it just keeps on loading. But when you enter wrong credentials it errors rightaway. This tells me theres somthing wrong with session and login cookie relationship.
The Forum post is edited by Marcus May 24 '19
dave Leader
dave May 24 '19
i do know that oxwall pings alot, more than any site i have ever seen, its constantly pinging and using resources.   I replied to your PM.. :)
Marcus
Marcus May 24 '19
Oxwall most likelly never tested the script performance under the heavy usage or traffic. Any suggestion about how to bring all those pinging under control.
dave Leader
dave May 24 '19
The first thing i would do if i had to, i would split up the cron jobs to run more effectively, there are too many cron jobs happening and that takes alot of resources.   


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. 

The Forum post is edited by dave May 24 '19
dave Leader
dave May 24 '19
I believe alot of the pinging is caused  by the onboard chat system and i dont know how to fix that because i have never looked into it.  But i do know that just that feature pings like crazy all the time.   You might try disabling that feature and see if things improve. 
Marcus
Marcus May 24 '19
Thanks dave. Where can i turn that off jyst for testing purposes
Marcus
Marcus May 24 '19
If pinging was to blame that uses up too many resorses that would be reflected across the site affecting guests too but its not only users. Again some times it runs fast the stalls. I get over 100 logins 
dave Leader
dave May 24 '19
you can turn that off in the messages plugin settings 
Marcus
Marcus May 24 '19
I see no such settings there. Need to edit code. P.s the problem begun after i switched to php 5.6 dint have in on php 5.4
Pages: 1 2 3 »