nystudio107 / craft-webperf

Webperf helps you build & maintain high quality websites through Real User Measurement of your website's performance
https://nystudio107.com/plugins/webperf
Other
25 stars 2 forks source link

Webperf blocking logout on front end? #21

Open chadcrowell opened 5 years ago

chadcrowell commented 5 years ago

I was really surprised at this, but since I built and launched store.gcx.com, I've had 2 weird issues:

1) Logging into the Control Panel takes 2 clicks of the submit button 2) Front end logout link not working

These are both reported and dealt with everyday by both me and my client. I've had them on my list to fix.

I sat down today to figure out which plugin (likely) was causing these issues. Because I am weird, I tend to do things from the bottom up. I started by disabling Webperf. Lo and behold #2 is now fixed. I logged in and out on the front end a bunch of times. Reactivated Webperf, and the logout stopped working. Disabled again, and logout worked. I pushed my project config changes to production, disabling Webperf there, and logout is working.

khalwat commented 5 years ago

Can I get a look at the site in question @chadcrowell ? This doesn't make a whole lot of sense to me.

chadcrowell commented 5 years ago

Sure. I'll send you access info in Discord PMs

khalwat commented 5 years ago

So in experimenting, I found that if I click on your "log out" link and then quickly click on the Account link, I'm always logged out.

So what I think is happening is you click the logout link which redirects to the home page, which includes the JavaScript in the head for Webperf that sends along the beacon data.

My guess is that the beacon data sends along with it the Craft login cookies so that it acts like a "tickle" to keep you logged in. Thus if you do the logout quick enough, beacon never fires, and you're logged out as expected.

It's very interesting.

khalwat commented 5 years ago

Added https://github.com/craftcms/cms/issues/4855 to seek clarity on the logout process