[Skip to main content](#vessel-content)

#   cookies in cart

##

- **[dimavricos](/forum/user/35542-dimavricos "View dimavricos's Profile")**
- [![dimavricos's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35542-dimavricos "View dimavricos's Profile") Topic Author
- [ Offline](/forum/user/35542-dimavricos)

Less More

- Posts: 3
- Thank you received: 0
-
-

11 years 9 months ago [\#184822](#184822) by [dimavricos](/forum/user/35542-dimavricos "View dimavricos's Profile")  *[cookies in cart](/forum/31-development/873926-cookies-in-cart#184822 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3  Is there an easy way to create cookies for the shoping cart? For example, if the user has 2 items in the cart , close the browser and then open again then show the 2 items again and not empy cart.  Thanks")* was created by *[dimavricos](/forum/user/35542-dimavricos "View dimavricos's Profile")*

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3

Is there an easy way to create cookies for the shoping cart?
For example, if the user has 2 items in the cart , close the browser and then open again then show the 2 items again and not empy cart.

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3MzkyNi1jb29raWVzLWluLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")**
- [![lousyfool's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar28604.jpg)](/forum/user/28604-lousyfool "View lousyfool's Profile")
- [ Offline](/forum/user/28604-lousyfool)

Less More

- Posts: 2143
- Thank you received: 747
-
- [](http://www.inphase.one)
-

11 years 9 months ago [\#184824](#184824) by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")  Replied by *[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")* on topic *[cookies in cart](/forum/31-development/873926-cookies-in-cart#184824 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3  Is there an easy way to create cookies for the shoping cart? For example, if the user has 2 items in the cart , close the browser and then open again then show the 2 items again and not empy cart.  Thanks")*

It works like that out of the box - at least it does for me.
However, browser settings could prevent the cookies from being stored, so best check the browser in use, or try another browser with its default settings?

---

Need help with customisations of layouts, style or other site development? [ PM me!](/component/uddeim/?task=new)
(Don't forget to turn on [ "E-mail notification of new messages"](/component/uddeim/?task=settings))

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3MzkyNi1jb29raWVzLWluLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dimavricos](/forum/user/35542-dimavricos "View dimavricos's Profile")**
- [![dimavricos's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35542-dimavricos "View dimavricos's Profile") Topic Author
- [ Offline](/forum/user/35542-dimavricos)

Less More

- Posts: 3
- Thank you received: 0
-
-

11 years 9 months ago [\#184826](#184826) by [dimavricos](/forum/user/35542-dimavricos "View dimavricos's Profile")  Replied by *[dimavricos](/forum/user/35542-dimavricos "View dimavricos's Profile")* on topic *[cookies in cart](/forum/31-development/873926-cookies-in-cart#184826 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3  Is there an easy way to create cookies for the shoping cart? For example, if the user has 2 items in the cart , close the browser and then open again then show the 2 items again and not empy cart.  Thanks")*

Hi, thanks for you quick reply.
I checked it on chrome and ie with default settings but both after reopening the cart is empty.
This happens when i close the browser not the tab.
So is there a way to do something like this? This really helps the ux.
Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3MzkyNi1jb29raWVzLWluLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")**
- [![lousyfool's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar28604.jpg)](/forum/user/28604-lousyfool "View lousyfool's Profile")
- [ Offline](/forum/user/28604-lousyfool)

Less More

- Posts: 2143
- Thank you received: 747
-
- [](http://www.inphase.one)
-

11 years 9 months ago [\#184831](#184831) by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")  Replied by *[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")* on topic *[cookies in cart](/forum/31-development/873926-cookies-in-cart#184831 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3  Is there an easy way to create cookies for the shoping cart? For example, if the user has 2 items in the cart , close the browser and then open again then show the 2 items again and not empy cart.  Thanks")*

Urgh, sorry, now I'm getting it: close the browser (= quit)...

Well, typically it's considered a security feature e.g. in case computers are shared by multiple people, and of higher priority than the UX for a single user.
Though your argument (UX) is well understood, along these lines and in the interest of your site visitors/users I'd recommend leaving it as is... even if it doesn't answer your original question... ![;)](/media/kunena/emoticons/11.png ";)")

---

Need help with customisations of layouts, style or other site development? [ PM me!](/component/uddeim/?task=new)
(Don't forget to turn on [ "E-mail notification of new messages"](/component/uddeim/?task=settings))

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3MzkyNi1jb29raWVzLWluLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dimavricos](/forum/user/35542-dimavricos "View dimavricos's Profile")**
- [![dimavricos's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/35542-dimavricos "View dimavricos's Profile") Topic Author
- [ Offline](/forum/user/35542-dimavricos)

Less More

- Posts: 3
- Thank you received: 0
-
-

11 years 9 months ago [\#184841](#184841) by [dimavricos](/forum/user/35542-dimavricos "View dimavricos's Profile")  Replied by *[dimavricos](/forum/user/35542-dimavricos "View dimavricos's Profile")* on topic *[cookies in cart](/forum/31-development/873926-cookies-in-cart#184841 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3  Is there an easy way to create cookies for the shoping cart? For example, if the user has 2 items in the cart , close the browser and then open again then show the 2 items again and not empy cart.  Thanks")*

Indeed this is right about the computers that are shared.
Thought, the cart contains info which are are simple and for me dont need to be secured as it has to be for example the checkout steps. So i am sorry that i insist on this but can you tell me if there is a way do it?
Thanks ![:)](/media/kunena/emoticons/8.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3MzkyNi1jb29raWVzLWluLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 9 months ago [\#184843](#184843) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[cookies in cart](/forum/31-development/873926-cookies-in-cart#184843 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3  Is there an easy way to create cookies for the shoping cart? For example, if the user has 2 items in the cart , close the browser and then open again then show the 2 items again and not empy cart.  Thanks")*

Hi,

That's already the case by default. However, the cookies will expired based on the "session lifetime" setting of the Joomla configuration.
So if you set that option to 1 day, the cart will only be kept for 1 day.

Also for registered users, the cart will be kept longer based on the "cart retaining period" option of the HikaShop configuration.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3MzkyNi1jb29raWVzLWluLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[korzo](/forum/user/34428-korzo "View korzo's Profile")**
- [![korzo's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar34428.png)](/forum/user/34428-korzo "View korzo's Profile")
- [ Offline](/forum/user/34428-korzo)

Less More

- Posts: 193
- Thank you received: 76
-
-

11 years 9 months ago -  11 years 9 months ago [\#184875](#184875) by [korzo](/forum/user/34428-korzo "View korzo's Profile")  Replied by *[korzo](/forum/user/34428-korzo "View korzo's Profile")* on topic *[cookies in cart](/forum/31-development/873926-cookies-in-cart#184875 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3  Is there an easy way to create cookies for the shoping cart? For example, if the user has 2 items in the cart , close the browser and then open again then show the 2 items again and not empy cart.  Thanks")*

Long story short, for guest user:

- with default browser settings cart is lost when he closes the browser.
- with "Continue where you left off" set on, cart will last for "cart retaining period" days.

For guest user cart is identified by session id.
Joomla session depends on session cookie and "session lifetime" mentioned by nicolas.

After "session lifetime" period, session is considered expired and is deleted by PHP(session garbage collector) on next request with probability 1%(by default).

Session cookie should be deleted when user closes browser, but this is ignored by most browsers when "Continue where you left off(Chrome)/Show my windows from last time(Firefox)" is set.

If there is no session but session cookie exists, Joomla will reuse session id from cookie.

Last edit: 11 years 9 months ago by [korzo](/forum/user/34428-korzo "View korzo's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3MzkyNi1jb29raWVzLWluLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.283 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
