Hikashop Business & Cookies

  • Posts: 49
  • Thank you received: 2
4 years 6 months 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: 81539
  • Thank you received: 13069
  • MODERATOR
4 years 6 months 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: 49
  • Thank you received: 2
4 years 6 months 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: 81539
  • Thank you received: 13069
  • MODERATOR
4 years 6 months 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: 49
  • Thank you received: 2
4 years 6 months ago #311709

Thanks Nicolas :)

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

  • Posts: 49
  • Thank you received: 2
4 years 6 months 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: 81539
  • Thank you received: 13069
  • MODERATOR
4 years 6 months 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: 49
  • Thank you received: 2
4 years 6 months ago #312147

Thanks again for your help ;)

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

  • Posts: 2
  • Thank you received: 0
3 years 1 month ago #330667

nicolas wrote: 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.


Hello, has this hidden setting been introduced in the meantime?
I want to ensure that the Hikashop cookies are only saved for the duration of a session.

Regards, Karlemagne

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
3 years 1 month ago #330725

Hi,

Yes. You can create an entry in the hikashop_config table via your PHPMyAdmin with the config_namekey cart_cookie_retaining_period and the config_value being the number of seconds you want the cookie to be kept so that it will override the default value of 31557600

The following user(s) said Thank You: Karlemagne

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

  • Posts: 2
  • Thank you received: 0
3 years 1 month ago #330736

Thank you very much, nicolas!

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

Time to create page: 0.079 seconds
Powered by Kunena Forum