Loading ...
Sorry, an error occurred while loading the content.

Apache::Session Error Handling.

Expand Messages
  • zeshanism
    Wondering how I can show custom error message if session file doesn exist. http://search.cpan.org/~cwest/Apache-Session/Session/File.pm If session file
    Message 1 of 1 , Sep 23, 2004
    • 0 Attachment
      Wondering how I can show custom error message if session file doesn'
      exist.

      http://search.cpan.org/~cwest/Apache-Session/Session/File.pm

      If session file doesn't exist:

      using CGI::Carp qw(fatalsToBrowser);

      Software error:
      Object does not exist in the data store
      at /usr/share/perl5/Apache/Session/Store/File.pm line 90.


      Is there a way that I can use:
      || die "Sorry, your session has expired $!";


      if yes, where I can use it in the code? or should I validate file
      existance separately? (-f, $id)?


      ############################################

      use Apache::Session::File;

      tie %hash, 'Apache::Session::File', $id, {
      Directory => '/tmp/sessions',
      LockDirectory => '/var/lock/sessions',
      };


      ###########################################


      Thanks.
    Your message has been successfully submitted and would be delivered to recipients shortly.