0

I have a Drupal commerce install, with commerce entity membership among other modules. Everything is working fine from my computer, I tested with all kinds of users and roles, but my client (in Belgium) and his new users experience many issues, they get logged out when accessing views where I restricted access to specific roles. The site is in production, customers are coming, they join as members but this issue will cause troubles I fear. I used .htaccess to redirect www to domain, again on my home computers and mobile phone it's working fine... I don't know what to do. Can someone help ? Edit : I created a rule to redirect users on first login (one-time-login link provided in welcome email) to the account edit page

{ "rules_first_time_login" : {    "LABEL" : "first time login",    "PLUGIN" : "reaction rule",    "WEIGHT" : "0",    "OWNER" : "rules",    "REQUIRES" : [ "rules" ],    "ON" : { "user_login" : [] },    "IF" : [ { "data_is_empty" : { "data" : [ "site:current-user:last-access" ] } } ],    "DO" : [ { "redirect" : { "url" : "user\/[account:uid]\/edit" } } ]  } }

Another rule is triggered for these users to be redirected to members' area

{ "rules_redirect_user_on_password_change" : {    "LABEL" : "Redirect user on password change",    "PLUGIN" : "reaction rule",    "OWNER" : "rules",    "REQUIRES" : [ "rules" ],    "ON" : { "user_update" : [] },    "IF" : [
     { "NOT data_is_empty" : { "data" : [ "account:last-login" ] } },
     { "user_has_role" : {
         "account" : [ "account" ],
         "roles" : { "value" : { "4" : "4", "5" : "5" } },
         "operation" : "OR"
       }
     }    ],    "DO" : [ { "redirect" : { "url" : "[site:url]members" } } ]  } }

A third rule for normal users after login

{ "rules_redirect_to_members" : {    "LABEL" : "redirect to members",    "PLUGIN" : "reaction rule",    "WEIGHT" : "1",    "OWNER" : "rules",    "REQUIRES" : [ "rules" ],    "ON" : { "user_login" : [] },    "IF" : [
     { "user_has_role" : {
         "account" : [ "account" ],
         "roles" : { "value" : { "4" : "4", "5" : "5" } },
         "operation" : "OR"
       }
     },
     { "NOT text_matches" : { "text" : [ "site:current-page:path" ], "match" : "user\/reset" } }    ],    "DO" : [ { "redirect" : { "url" : "[site:url]members" } } ]  } }

Do you see any misconfiguration ?

1 Answer 1

0

Some browsers, as Firefox for example are treating subdomains as www as totally different domains. So, if user logs in at www.domain.com and you re-direct it to domain.com it will not be logged in any more on some browsers. Try it your self with Firefox - I don't think it's location, but browser related.

1
  • Yes you are right, but everything is ok about this. As everything is ok on my computer (tested with 5 different browsers) and my mobile android, I suspect it is related to cookies management which must not be correct on some browsers' old version (I saw there were issues like mine on old Safari). I cannot see what I can do about this, I tried to disable cache for anonymous users. The problem is I cannot test this myself...
    – duck
    Sep 6, 2015 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.