I understand that you should not rely solely on the presence or absence of a cookie to decide if the user is logged on or not.
I was just providing a small sample code to illustrate the fact that I am unable to save a new session ID cookie to the browser.
I'm astonished at how difficult sessions are to get working, even for an experienced Perl programmer like me.