Perhaps not the answer you were looking for, but maybe you need a framework that supports server side redirects, e.g. with Catalyst your login controller would be able to forward control to the admin controller without going through an HTTP redirection.
Comment on Re^3: CGI::Application redirect loses cookie