Logging In During Checkout Error

  • Posts: 36
  • Thank you received: 2
3 years 7 months ago #331810

-- url of the page with the problem -- : tammytrent.com/shop/cart
-- HikaShop version -- : 4.4.2
-- Joomla version -- : 3.9.26
-- PHP version -- : 7.4.11
-- Browser(s) name and version -- : Chrome Version 89.0.4389.114
-- Error-message(debug-mod must be tuned on) -- : Warning
Your session has expired. Please log in again.
You have not agreed to accept cookies. This may be the cause of this error.

I'm getting this error when trying to login:

Warning
Your session has expired. Please log in again.
You have not agreed to accept cookies. This may be the cause of this error.

Can't in the world figure out how/where I'm supposed to accept cookies?

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 7 months ago #331826

Hi,

Well first the error "Your session has expired. Please log in again." is quite common with Joomla.
It usually happens when you try to do an action while your user session lifetime has expired. This is controlled by the "session lifetime" setting in the Joomla configuration. And when you don't display a new page after a number of seconds you configured in that setting, the system will consider you logged out of Joomla and will deny all the operations until you login again.

Regarding the second part of the error "You have not agreed to accept cookies. This may be the cause of this error." I'm not sure where this comes from. There is no such error in HikaShop and I couldn't find any information about that exact error message online.
However what I can say is this: For a user session to be alive, it needs to send a cookie to the browser so that each time the browser will request a page of the website, it will send the cookie along so that the server will know who is requesting the page.
Normally, this happens automatically between Joomla and the browser.
The error message suggests that this is blocked and there are two reasons this can usually happen:
- if you have a browser extension or a browser setting which blocks cookies. You can check with another browser to see if you have the same issue to make sure that it doesn't come from something on your browser.
- if you have a cookie extension ( you can find many such extensions available on the JED: extensions.joomla.org/category/site-management/cookie-control/ ). And maybe that extension is not configured properly.

Finally, you say that this error happens when you try to login during the checkout in HikaShop's checkout. Do you have the issue elsewhere or really only there ? Also, do you have the issue if you try to login via Joomla's login form ? ( tammytrent.com/index.php?option=com_users&layout=login ). If you also have the issue with Joomla's login form, it would mean that it's not linked to HikaShop at all.
While if you have the issue with HikaShop's login and not Joomla's, it could indicate that the issue is linked to the fact that the login on the checkout is done through an AJAX request (without a refresh of the whole page). In such case, a way to circumvent the problem would be to disable the "login" setting of the Checkout tab of the HikaShop configuration in order to not display HikaShop's login form on the checkout, And instead, you could configure the Joomla "login" module via the joomla modules manager to be displayed on the checkout pages for guest users.

Please Log in or Create an account to join the conversation.

  • Posts: 36
  • Thank you received: 2
3 years 6 months ago #332095

Thank you so much for all of this info!! I'm testing everything now...

- This is also happening in Firefox (Chrome is what I first found the error). Except it won't even let me add products to the cart in Firefox. When I try, I get the error "Product Not Added to Cart. This operation can only work if you accept the use of cookies."

- Session Lifetime was set at 15 minutes. I noticed that cache was turned off, so I turned that to conservative.

- I use JCH Optimize and I just excluded the shop pages from the plugin...

It seems to be working now! I'm going to do a few more tests and make sure!

Please Log in or Create an account to join the conversation.

  • Posts: 36
  • Thank you received: 2
3 years 6 months ago #332096

Okay... well, I'm still getting the Error: "Product Not Added to Cart. This operation can only work if you accept the use of cookies." on different browsers. And I check the browser settings and they're set to allow all cookies...

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 6 months ago #332100

Hi,

15 minutes is quite small. It means that if you display a page and wait 15 minutes to click on the add to cart buttons on that page, the session will have expired. I would personally prefer a few hours to be on the safe side.

Also, I would recommend to first disable any cache / optimization extension you have and see if you still have the issue. If you don't, it means that it's linked to one of them so you can narrow it down. slowly enabling back these systems one by one until you identify which setting of which extension is causing the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 36
  • Thank you received: 2
3 years 5 months ago #333285

I didn't make any changes... but it seems to be working now.

The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.067 seconds
Powered by Kunena Forum