Fixed. it. Damn it. It was easy, but not obvious, which I am learning seems to be pretty standard, especially for beginners like me.
In the end it all I had to do was put the session_start() command at the very beginning. Before anything. Including the DOCTYPE line. W3Schools.com says to put it before the <html> line, but it has to go even higher.
I thought it was weird that the code to create the cookies had to come first. What idiot puts code before the start of the program, was what I was thinking, but that was the only thing that worked, and yes, I could stick my function CreateNewCookie in there, too.
So that sent me back to php.net to read up more on session_start and there were many accounts of problems like what I was having, with solutions. One was
Originally Posted by alakys
Sorry for the noob comment but for those having the error :
It might sound funny but I am sure this post will save time to some others noobs like me ... !
Many thanks, alakys. I suffered plenty before I found your post and tried it so I didn't save much time, but damn I was getting headaches, cramps, a really sore butt, and was close to giving up, and I would have hated myself forever for that.
I'll put it to bed tonight, get another late dinner, and will turn up my amp and bang on my guitar until I get some of this out of my system. It's 9:30 PM on a Saturday. The neighbors will understand.
P.S. How the hell did I ever get this to work at all? For the past week or so SESSIONS was working for me, on this one machine.