TIL How to Make and Use PHP Cookies

When I first created popRock, I had a heck of a time getting the artistID session variable to travel from page to page — so you could see various charts and lists for the artist chosen from my hideously coded Choose Artist menu on the choose_artist page. I finally got it working but, a couple months ago, I switched hosting plans and the app stopped working.

I still haven’t converted it all to AJAX as mentioned in the aforelinked link, but in the meantime, everything is working again because I finally gave PHP cookies a chance. Yay. I wish I’d used them from the beginning it is SO easy! But I read countless articles about why you shouldn’t use them and should use sessions instead. Well, sessions can kiss my butt as I walk out the door because I’m breaking up with them.