# How to count the number of cookies

**URL:** <https://forum.xojo.com/t/how-to-count-the-number-of-cookies/24269>\
**Category:** Web\
**Created:** [May 15, 2015, 5:53pm UTC](https://forum.xojo.com/t/how-to-count-the-number-of-cookies/24269 "2015-05-15T17:53:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Theodore\_Ems](https://forum.xojo.com/letter_avatar_proxy/v4/letter/t/48db29/32.png) [@Theodore\_Ems](https://forum.xojo.com/u/Theodore_Ems)\
**Post date:** [May 15, 2015, 5:53pm UTC](https://forum.xojo.com/t/how-to-count-the-number-of-cookies/24269/1 "2015-05-15T17:53:47Z")

</div>

I’m trying to count the number of cookies in a browser.  
This goes in the open event of the session  
dim n as integer  
n= self.Cookies.Count  
msgbox “There are " +str(n) + " cookies”

What i get back is zero on Safari and Chrome. What do i need to do to get this to work properly?

---

<div class="post-metadata">

**Author:** ![Mark\_Walsh](https://forum.xojo.com/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@Mark\_Walsh](https://forum.xojo.com/u/Mark_Walsh)\
**Post date:** [May 15, 2015, 9:19pm UTC](https://forum.xojo.com/t/how-to-count-the-number-of-cookies/24269/2 "2015-05-15T21:19:47Z")

</div>

Please forgive me for this post being of no help whatsoever, but I couldn’t resist.

[https://www.youtube.com/watch?v=5l7KbMVdN7E](https://www.youtube.com/watch?v=5l7KbMVdN7E)

---

<div class="post-metadata">

**Author:** ![Theodore\_Ems](https://forum.xojo.com/letter_avatar_proxy/v4/letter/t/48db29/32.png) [@Theodore\_Ems](https://forum.xojo.com/u/Theodore_Ems)\
**Post date:** [May 18, 2015, 12:47am UTC](https://forum.xojo.com/t/how-to-count-the-number-of-cookies/24269/3 "2015-05-18T00:47:08Z")

</div>

This is a mobile application so the count version doesn’t apply.

---

<div class="post-metadata">

**Author:** ![Theodore\_Ems](https://forum.xojo.com/letter_avatar_proxy/v4/letter/t/48db29/32.png) [@Theodore\_Ems](https://forum.xojo.com/u/Theodore_Ems)\
**Post date:** [May 18, 2015, 12:49am UTC](https://forum.xojo.com/t/how-to-count-the-number-of-cookies/24269/4 "2015-05-18T00:49:44Z")

</div>

Ive tried windows mobile running their browser and all works fine. With chrome on android the count returns zero. Safari on iPhone works.

Am i missing something?

---

<div class="post-metadata">

**Author:** ![Thom\_McGrath](https://forum.xojo.com/user_avatar/forum.xojo.com/thom_mcgrath/32/192_2.png) [@Thom\_McGrath](https://forum.xojo.com/u/Thom_McGrath)\
**Post date:** [May 18, 2015, 2:58am UTC](https://forum.xojo.com/t/how-to-count-the-number-of-cookies/24269/5 "2015-05-18T02:58:07Z")

</div>

Stupid question, but you’ve set at least one cookie, right?

---

<div class="post-metadata">

**Author:** ![Theodore\_Ems](https://forum.xojo.com/letter_avatar_proxy/v4/letter/t/48db29/32.png) [@Theodore\_Ems](https://forum.xojo.com/u/Theodore_Ems)\
**Post date:** [May 18, 2015, 3:28pm UTC](https://forum.xojo.com/t/how-to-count-the-number-of-cookies/24269/6 "2015-05-18T15:28:51Z")

</div>

Oh yes on the mobiles at least 5 or more, the many other desktop browser applications worked fine. Mobile versions I’m having difficulty getting to work properly across all OS’s and browsers.

I used the Counting example as the simplest form that had not worked on the android version 5.1/Chrome 42.0.2311.152-M

As an update. Looks like the mobile apps need to have the cache cleared and tabs closed that may have been opened. Especially after an App update. This doesn’t seem to be a problem on the iPhone and safari. Why does this have anything to do with reading or counting cookies?

2 laptops running the same version of Chrome( setup the same ) and windows 8.1 have 2 different results. One works fine the other doesn’t. The difference, one is a pentium the other an i3. Tried the clear cache, website data and turning the computer off then back on didn’t help on the i3.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 5:45pm UTC](https://forum.xojo.com/t/how-to-count-the-number-of-cookies/24269/7 "2020-10-29T17:45:22Z")

</div>


