You're using Apache::Session and sometimes the data doesn't stay saved when you think it should (like mentioned in Re: State-keeping modules). Chances are it's a closure that is to blame.

Just add the DESTROY method to your derived class and it will spew a warning anytime it detects this happening. (YMMV of course.)

package Apache::Session::Derived::Class; use strict; our $VERSION = '1.00'; our @ISA = qw(Apache::Session); use Apache::Session; ... sub populate { my $self = shift; ... return $self; } sub DESTROY { my $self = shift; local $@; eval { $self->save; }; if ( $@ ) { my $error = $@; my $msg = q{Can't call method ".*?" on an undefined value at } . q{.*?/Apache/Session\.pm line \d+ during global destruct +ion.}; if ( $error =~ m/$msg/ ) { warn "Unable to save session changes! (Closure around sessio +n?)\n"; } else { warn $error; } } $self->release_all_locks; } 1;

I would like to thank diotalevi for pointing out the need for localizing $@.


In reply to (Apache::Session) Detect a Failure to Save Session by Mr. Muskrat

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.