Storing data like a cookie?

How would you go about holding data in a P5 sketch online if someone came back to it later.

For example, if I had a piece of code where you can choose the fill color of a rect, how could you make it store that value so if you closed the sketch and opened it again it would still be the last fill color you chose.

I understand in processing this would be easier as you could store the value in a text file between uses, but seeing as p5 is web based I’m not sure how to go about it and there doesn’t seem to be anything in the documentation.

Many thanks in advance

1 Like
2 Likes

Ah, getItem() and storeItem() sound perfect, didn’t realise it would be so easy to do :sweat_smile:

Many thanks as always g2l