This is probably not directly related to the problem you're experiencing, but for what it's worth, the Apache::Session documentation says:

When Session encounters an error, it calls die(). You will probably w +ant to wrap your session logic in an eval block to trap these errors.

He's not kidding. If you supply the TIEHASH method with either a funky session ID, or a session ID for which there is no session in the store, Session dies. Do something like this to handle potential exceptions:

eval { tie %session, 'Apache::Session::File', $session_cookie, { Directory => "../data/sessions", LockDirectory => "../data/sessions" }; }; if ($@) { # since the first attempt failed, supply the # undefined value as the session ID argument # so that Session will generate a new session tie %session, 'Apache::Session::File', undef, { Directory => "../data/sessions", LockDirectory => "../data/sessions" } }

Also, since you're a smart Perl developer and you're using taint mode, you'll want to untaint the session ID before passing it to Apache::Session. The session ID is inserted in session filenames and lock filenames, and Perl will raise an exception if you don't untaint it.

Update:

For what it's worth, it doesn't look like Apache::Session has even been tested on Win32. test report.

If you're having a problem with Fcntl, you might look into Apache::Session::Flex, which should allow you to use your own file locking code. You may be able to use File::FlockDir to do most of the work.


In reply to Re: Apache::Session hangs by converter
in thread Apache::Session hangs by Mandor

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.