As usual, CPAN knows all.
CGI::Capture was written to replace CGI.pm's pitiful save functionality, and does exactly what you want, including the environment file uploads, cookies, checking you are the same user, etc etc etc.
It lets you "record" a CGI call to a file, and then play it back as many times as you want.