new CGI seems to be called several times. I see no reason why it can't be just once for this code. In most cases one initialises an object by assigning it to a "new" for a class and can in most cases expect to stick to that one object for all further uses of the class.
Your use of CGI::Session seems limited to the new method but no other methods are called and the object will be destroyed as soon as it goes out of scope - try to decide what scope the session object needs and declare the object there. Also take a look through the methods here to decide which ones you need to call. CGI::Session