Hikashop Business & Cookies

  • Posts: 37
  • Thank you received: 1
  • Hikashop Business
2 weeks 6 days ago #311621

-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.12
-- PHP version -- : 7.2.23
-- Browser(s) name and version -- : Google Chrome

Hi,

is there a way to change the duration how long a cookie is stored on a customers computer?
I´ve checked it with our shop on Google chrome, is it correct that the cookies are stored 1 year? See also attachment.

We use the latest stable version of HikaShop Business: 4.2.1

Many thanks in advance for your help.

Best regards
Torsten

Attachments:

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

  • Posts: 67199
  • Thank you received: 9963
  • MODERATOR
2 weeks 5 days ago #311624

Hi,

There is no option to change that duration.
You would have to modify the code:

			setcookie('hikashop_'.$type.'_id', $element, time() + 31557600, "/");
			setcookie('hikashop_'.$type.'_session_id', $jsession->getId(), time() + 31557600, "/");
in the file administrator/components/com_hikashop/classes/cart.php
Note that 31557600 is the number of seconds for which the cookie is kept.

The following user(s) said Thank You: CorneliaML

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

  • Posts: 37
  • Thank you received: 1
  • Hikashop Business
2 weeks 5 days ago #311658

Hi Nicolas,

many thanks for your update, will the cart.php be overwritten with each update of Hikashop?

What about the idea to implement this in the admin panel of Hikashop? I´m pretty sure there will be more changes to the Cookie law and the GDPR in the following months.

Best regards
Torsten

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

  • Posts: 67199
  • Thank you received: 9963
  • MODERATOR
2 weeks 5 days ago #311668

Hi,

Yes, the change will be removed after each update.
In the admin panel, I'm not sure we want that. There are already too many options and there shouldn't be much need in changing that, at least for now.
What we could do though is to add a hidden setting so that the change could be done without changing the code but with a small change in the database.
We'll look into it.

The following user(s) said Thank You: CorneliaML

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

  • Posts: 37
  • Thank you received: 1
  • Hikashop Business
2 weeks 4 days ago #311709

Thanks Nicolas :)

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

  • Posts: 37
  • Thank you received: 1
  • Hikashop Business
1 week 9 hours ago #312104

Hello,

it´s me again regarding the cookies. Could you please tell me a bit more about the function and the content that is stored in the cookies?



Many thanks
Torsten

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

  • Posts: 67199
  • Thank you received: 9963
  • MODERATOR
1 week 3 hours ago #312106

Hi,

What is stored there is the PHP session ID and the cart ID of the guest user.
That, way if the user comes again to the website and that this information is provided, we'll be able to attach the old cart of the user to his new user session.
When a cart is used by a guest on HikaShop the session ID of the user is stored along with the cart in the database.
So basically, by storing the session id in a cookie along with the cart id, it allows us to verify that the cart requested by the browser of the user corresponds to the user (and not somone trying to retrieve the cart of someone else).

The following user(s) said Thank You: CorneliaML

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

  • Posts: 37
  • Thank you received: 1
  • Hikashop Business
6 days 22 hours ago #312147

Thanks again for your help ;)

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

Time to create page: 0.064 seconds
Powered by Kunena Forum