'I need a few things explained though. These are the lines'
Those are all of the 'lines' that deal with the cookie. So all I got from your reply is that you know how to decalare variables and write a print statement? As far as your question about query:
This will parse the input (from both POST and GET methods) and store it into a perl5 object called $query.
As read in the POD. I think $stilllogged should be pretty intuitive. Have you looked at any of the documentation of CGI
yet (as we asked in the beginning)? I am not being condescending, but it sounds like that is where you need to start. It is critical you can understand what you are using or trying to use so we can help you. The documentation usually can answer many of your questions quite quickly.