data/TWiki/CGISessionDriverFileDotPm.txt,v
author Colas Nahaboo <colas@nahaboo.net>
Sat, 26 Jan 2008 15:50:53 +0100
changeset 0 414e01d06fd5
permissions -rw-r--r--
RELEASE 4.2.0 freetown
     1 head	1.1;
     2 access;
     3 symbols;
     4 locks; strict;
     5 comment	@# @;
     6 
     7 
     8 1.1
     9 date	2008.01.22.03.21.36;	author TWikiContributor;	state Exp;
    10 branches;
    11 next	;
    12 
    13 
    14 desc
    15 @buildrelease
    16 @
    17 
    18 
    19 1.1
    20 log
    21 @buildrelease
    22 @
    23 text
    24 @---+ Package ==
    25 
    26 %TOC%
    27 =head1 NAME
    28 
    29 CGI::Session::Driver::file - Default CGI::Session driver
    30 
    31 =head1 SYNOPSIS
    32 
    33     $s = new CGI::Session();
    34     $s = new CGI::Session("driver:file", $sid);
    35     $s = new CGI::Session("driver:file", $sid, {Directory=>'/tmp'});
    36 
    37 
    38 =head1 DESCRIPTION
    39 
    40 When CGI::Session object is created without explicitly setting I<driver>, I<file> will be assumed.
    41 I<file> - driver will store session data in plain files, where each session will be stored in a separate
    42 file.
    43 
    44 Naming conventions of session files are defined by C<$CGI::Session::Driver::file::FileName> global variable. 
    45 Default value of this variable is I<cgisess_%s>, where %s will be replaced with respective session ID. Should
    46 you wish to set your own FileName template, do so before requesting for session object:
    47 
    48     $CGI::Session::Driver::file::FileName = "%s.dat";
    49     $s = new CGI::Session();
    50 
    51 For backwards compatibility with 3.x, you can also use the variable name
    52 C<$CGI::Session::File::FileName>, which will override the one above. 
    53 
    54 =head2 DRIVER ARGUMENTS
    55 
    56 If you wish to specify a session directory, use the B<Directory> option, which denotes location of the directory 
    57 where session ids are to be kept. If B<Directory> is not set, defaults to whatever File::Spec->tmpdir() returns. 
    58 So all the three lines in the SYNOPSIS section of this manual produce the same result on a UNIX machine.
    59 
    60 If specified B<Directory> does not exist, all necessary directory hierarchy will be created.
    61 
    62 By default, sessions are created with a umask of 0660. If you wish to change the umask for a session, pass
    63 a B<UMask> option with an octal representation of the umask you would like for said session. 
    64 
    65 =head1 NOTES
    66 
    67 If your OS doesn't support flock, you should understand the risks of going without locking the session files. Since
    68 sessions tend to be used in environments where race conditions may occur due to concurrent access of files by 
    69 different processes, locking tends to be seen as a good and very necessary thing. If you still want to use this 
    70 driver but don't want flock, set C<$CGI::Session::Driver::file::NoFlock> to 1 or pass C<< NoFlock => 1 >> and this 
    71 driver will operate without locks.
    72 
    73 =head1 LICENSING
    74 
    75 For support and licensing see L<CGI::Session|CGI::Session>
    76 
    77 @