Incrementing cookie value

So today I tried to set up a cookie on a new page - I wanted to set it up so that it would show a modal 5 times (to be sure a new user digested the additional / important information I had put on the modal). I have a modal now that comes up once (thanks to Teodor). But this one I wanted to come up 5 times. I set everything up so that the cookie would be incriminated by 1 each time the user clicks the close button on the modal.

Much to my surprise when I used +1 operator the cookie value (which I had defaulted to zero) went to 1 on the first click, then 11 on the second click and 111 on the third click. I had set the cookie variable up as a number so this did not makes much sense to me.

Next I looked for a ++ operation I could add - I could not see one (see photo below). Then I tried just using <= 11111. Another big surprise – now the cooke was showing up as FALSE vice how it behaved above.

Can someone please tell me how to increment a cookie value so I can display it the number of times I would like?

2018-11-29_08-20-24

Community Page
Last updated: