- Posts: 32
COMMUNITY FORUM
Login bug
- Webcrea
-
Topic Author
- Offline
- Junior Member
Only with firefox...
When I log in from a k2 page.
I'm effectivly logged, but I have to make F5 to see the good menu.
From another page is not k2, no problem
www.winescholarguild.org/champagne-immersion-study-trip-champagne-wine-tour
Regards
chris
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
Comment out these 2 lines github.com/getk2/k2/blob/master/components/com_k2/views/item/view.html.php#L465-L468 for now and I'll make sure this is optional in the next update of K2 via a switch in the K2 Settings.
Please Log in or Create an account to join the conversation.
- Webcrea
-
Topic Author
- Offline
- Junior Member
- Posts: 32
I made the change but no. this is the same thing... After login, it's like I'm not connected!
Do you want an access to our website?
Regards
Chris
Please Log in or Create an account to join the conversation.
- webcrea
-
- User
Can you try to help us further on this? Login not working normally on K2 pages when users use Firefox is a real problem. We get requests for support all the time.
Here is a test account for you to check the issue: Username ****** and password ******.
Try to log in from Firefox on a page like this one: www.winescholarguild.org/study-programs-overview/iws-prep-course
When you log in, the top menu still says "log in". If you refresh, then it changes to "My Account" like it should.
We really hope you can help.
Chris
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
Testing your URL, there's a "Cache-Control: must-revalidate" HTTP header sent that is probably causing these issues. See why in the MDN docs here: developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
And since you don't (obviously) have the means to revalidate these URLs, you get these problems.
Now, this HTTP header may come from some other Joomla system plugin or it may be inserted in your site's .htaccess file (since you're using Apache as your webserver).
Dig around too see what's injecting that HTTP header and remove it.
Please Log in or Create an account to join the conversation.
- Webcrea
-
Topic Author
- Offline
- Junior Member
- Posts: 32
We don't have any instruction for the cache-control in our .htaccess. And, if it's the problem, why only pages from K2 should be affected? All pages should be infected, no?
Where can I see the cache-control effect please?
I found some code from JCH optimize in the .htaccess. I deleted all the code about cache. The issue is not solved.
Regards
Chris
Please Log in or Create an account to join the conversation.
- webcrea
-
- User
Where can I see the cache-control effect please? I found some code from JCH optimize in the .htaccess. I deleted all the code about cache. The issue is not solved.
Also, while we thought that the problem was specific to Firefox, in fact there is also almost the exact same issue on Chrome.
On Chrome or I.E., if you login on a k2 page, it works. You are logged in. When you log out, you get redirected to the homepage and are logged out. But if you navigate back to any k2 item page that you had visited when you were logged in (not category... in category view it is fine), then the main menu still says "My Account" (vs "Login") unless you refresh the page manually. At the bottom of the K2 page, I do have the Comment box on blog articles (comments are only active for logged in users) but I can't post a comment (it shows as if I was logged in but I am not).
K2 items you had not visited while logged in show the menu correctly after logout. It is only those you had previously visited.
So it seams it is linked to a menu cache issue only on k2 item pages.
What a pain!
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
What I can confirm is that "Cache-Control: must-revalidate" does not come from K2.
Ask your server's system administrator.
Please Log in or Create an account to join the conversation.
- Webcrea
-
Topic Author
- Offline
- Junior Member
- Posts: 32
Why this is only from the k2 component that the problem occurs? From other page there isn't any problem.
Chris
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
find /path/to/site/ -iname "*.php" | xargs grep "must-revalidate"
Run this via a terminal on the folder where your Joomla site is and it will reveal any extension that injects that HTTP header.
Please Log in or Create an account to join the conversation.
- Webcrea
-
Topic Author
- Offline
- Junior Member
- Posts: 32
Please Log in or Create an account to join the conversation.
- Webcrea
-
Topic Author
- Offline
- Junior Member
- Posts: 32
After send the command, many files are show... How can I find the solution of this issue?
Regards
Chris
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
Please Log in or Create an account to join the conversation.
- Webcrea
-
Topic Author
- Offline
- Junior Member
- Posts: 32
And if it is fixed, the fix was commenting out 1 line. In the file:
/public_html/components/com_k2/views/item/view.html.php line 459, changed:
JResponse::allowCache(true);
To this:
//JResponse::allowCache(true); # seyi_code COMMENT OUT
regards
Chris
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
Whatever works for you...
Please Log in or Create an account to join the conversation.