Hi Monks,

I have implemented Apache::Session::File for session management in my web application. For that we specify Directory and Lock Directory while tieing the session and what i have observed is that for each session_id, it creates one file named after session_id in the directory and two files in LockDirectory, out of which one is named after session_id and other one has some random number in its name.

what significance does these lock files have in session handling here?

Different requests to my web application(which can be concurrent also) alter session data in different ways. so sometimes session data gets lost in between those requests.

so my queries regarding sessions are:

What can i do to handle this data corruption? How Apache::Session::File handles concurrent access(for read,write) to session data.

Does Apache::Session::File provides some built in data locking mechanism. if yes, how does that work?

Any help would be appreciated.

In reply to Apache::Session::FIle Locking Mechanism by py_201

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.