in reply to Using CGI::Session inside a package?

I don't see any compelling reason not to put it in a package :)  It's no more or less dangerous than having it in the main script; and stylistically it's fine, too (IMHO).

But better name it Login (1st letter uppercase) — all-lowercase package names are "reserved" for pragmata, like use strict;