I've got a custom authentication system for a CGI::Application based site where I want to store a copy of a CGI object when a inactivity timeout occurs. I've got a solution that seems to work great that does the serialization with FreezeThaw, except when the CGI object results from a POST submission with a file upload field where it dies with error "Do not know how to thaw GLOB at /usr/lib/perl5/site_perl/5.8.6/FreezeThaw.pm line 505".

I'm guessing that FreezeThaw is barfing on the globs that the CGI module uses references the uploaded files. This kinda makes sense to me. If you've already got something in file, why bother trying to serialize a pointer to it?

I remembered that the CGI module had a method for saving state (save_parameters), but after testing it out, I noted that it doesn't do anything for upload files (the name of the upload file is preserved; not the content.)

Unless an esteemeed monk (with XP far greater than me!) has an alternative approach, I'll probably go under the hood of the CGI module and figure out how to save copies of the uploaded files myself and recreate pointers to them when I restore the CGI object again in the future.

Am I overlooking a simpler solution?

Thanks for any help!


In reply to Suggestion- How to serialize a cgi object? by pffan239

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.