My cookie code (which finally works)-- $cookie = cookie(-name => 'sessionID', -value => makeCookieValue($userpass), -expires => '+1h' );