2

It's the first time i'm posting on a forum but i've been really stuck with this problem for a few days. So thanks for your help.

I'm working on a site that's entirely https. The site uses the anonym checkout possibilities. I recently observed that when a user wants to connect during checkout (using the "/user" link, I don't use extra pannel to log in), after adding a product to cart or after a purchase, he gets an error 403. Whatever role he has, he is stuck with this error. The login and the password are correct. And this doesn't happen when we are on another page. It only appears from the moment a user adds a product in the cart. Then he has to empty the session and cache of the navigator to connect to his account.

I don't understand the problem because I don't have this problem on localhost, the only difference i see between the two server is that i don't use https on the localhost. That's why i think it's a session problem but i'm not sure. I tried all the solutions proposed for the settings.php, I don't use secure page (i used to but i uninstalled it because the site is entirely https now). The site is on a subdomain.

I have made a redirection to htacess to redirect possible entry by http to https with this code: RewriteCond %{HTTPS} off RewriteRule ^(.*)$https://a.domain.com/$1[R=301,L]

I don't know what else to do, thanks for your help. Sorry if there's a lack of information, just tell me.

Thanks.

12
  • On which URI exactly you're getting 403, /user? Check the Rules if you don't have any suspicious triggers reacting on 'adding a product to cart'. Also check watchdog entries, if there is anything extra.
    – kenorb
    Feb 12, 2015 at 12:50
  • Thanks for your reply. Yes i'm getting the 403 on '/user'. Actually the only modification I've made in the rules is to redirect to the cart when a product is added to it. I added this on the commerce add to cart message rule. The watchdog entries only give me an access denied without more information. What's weird is that when we look at the order this one is attributed to the user(whatever the status of the order) but the user can't log in.
    – r.owl
    Feb 12, 2015 at 17:57
  • If you're using xdebug, you can use it to dump the trace file on /user page and it'll give you all the information which module generated 403 code as normally /user page doesn't have any permission restriction, see 'access callback' at user_menu().
    – kenorb
    Feb 12, 2015 at 18:05
  • Thanks again for your time. I don't know xdebug, but it's not installed on the server and i don't have the access to this one. But if i understand correctly, you think that the problem may come from an other module ?
    – r.owl
    Feb 12, 2015 at 18:17
  • Is it possible that the problem comes from the database? I'm not sure but i think that the problem occured after I've installed the "commerce checkout login" module. I had 403 errors after a purchase when we tried to log in from the /user link. So i uninstall this module but apparently the 403 error is still here. I'm not sure this is related.
    – r.owl
    Feb 12, 2015 at 18:26

1 Answer 1

0

My problem was a session bug with my version of php (5.6.3) the code from here contains a workaround:

function mymodule_user_login(&$edit, $account) {
  $_SESSION['mymodule']['ulogged'] = 1;
}

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.