Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

every time redirecting to my account page when i click home page #26

Closed
sivajik34 opened this issue Aug 30, 2016 · 7 comments
Closed

every time redirecting to my account page when i click home page #26

sivajik34 opened this issue Aug 30, 2016 · 7 comments
Assignees

Comments

@sivajik34
Copy link

After login every time redirecting to my account page when i click home page.
We have configured varnish cache.
Some times if i delete browser cache & refresh varnish it seems working fine.

@der-workfloh
Copy link
Contributor

Hi @sivajik34 ,

thank you for your information. To provide offical support for Varnish, I have to dig deeper into the mechanics of Magento2+Varnish first, so this issue may take a while before I can provide a solution.

@der-workfloh der-workfloh self-assigned this Aug 31, 2016
@sivajik34
Copy link
Author

sivajik34 commented Sep 1, 2016

More Information.
if i remove browser cache (no need of refresh varnish) its working fine.
steps to reproduce the issue:
1.with out login: request for any page (3 times or more)
2.then login
3.now click home page

observation : customer_session_init event is not calling on home page & some other cms pages.
may be helpful following link:
http://alexsiri7.tumblr.com/post/57164711488/problem-with-magento-full-page-cache-and-redirects
Can you look into this issue once ?
thanks in advance.

@der-workfloh
Copy link
Contributor

der-workfloh commented Sep 4, 2016

hi @sivajik34 ,

thanks for the additional information. Sadly I am not able to reproduce your issue at the moment.
Can you tell me more about your system? Which version of the module do you use? Magento 2.0 or 2.1, CE or EE?
Does this issue occur in every browser or just in a specifc one, and do you use some specific cache settings or extensions influencing the cache behaviour of your browser?
Have you added some rules or are you using the basic setup? Do you use any other extension that may be interfering with the functionality of the Force Login module?

@sivajik34
Copy link
Author

Magento 2.0 Enterprise ,On every browser I'm facing this issue. no other modules influenced.

@der-workfloh
Copy link
Contributor

Hi @sivajik34 ,

it seems the Magento 2.x Enterprise Edition works the Page Cache differently as the Community Edition and this may cause the described problems. We do not have the EE at hand, so it is not possible for us to test the module against it.
Perhaps you are able to contribute a working solution or if you require some assistance let us gain access to the EE to debug this issue.

@cowmix88
Copy link

cowmix88 commented Jan 16, 2017

I'm having a similar problem which is caused by the browser caching the original 302 redirection response. So for example if you go to a product page the browser will remember that product should go to the login page. After you are logged if you go that that product page again, the browser will remember the redirection and send you to the login page again which then redirects you to the My Account page since you're logged in.

I fixed this problem with varnish at least by adding a "set beresp.http.Cache-Control" the default Magento varnish config

# cache only successfully responses and 404s
    if (beresp.status != 200 && beresp.status != 404) {
        set beresp.ttl = 0s;
        set beresp.uncacheable = true;
        set beresp.http.Cache-Control = "no-store, no-cache, must-revalidate, max-age=0";
        return (deliver);

in sub vcl_backend_response

But it would probably be good for the plugin itself to also make sure its passing proper cache control headers when doing a redirect?

@der-workfloh
Copy link
Contributor

Hi @cowmix88 ,

thank you very much for this contribution, we will look into this.

der-workfloh pushed a commit to der-workfloh/magento2-force-login that referenced this issue Mar 20, 2017
der-workfloh pushed a commit to der-workfloh/magento2-force-login that referenced this issue Mar 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants