in reply to how I implement session cookie

You can use the CGI.pm module. For more info, type: perldoc CGI at the command prompt.