| 1 |
NAME |
| 2 |
CGI::Session - persistent session data in CGI applications |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
# Object initialization: |
| 6 |
use CGI::Session; |
| 7 |
$session = new CGI::Session(); |
| 8 |
|
| 9 |
$CGISESSID = $session->id(); |
| 10 |
|
| 11 |
# send proper HTTP header with cookies: |
| 12 |
print $session->header(); |
| 13 |
|
| 14 |
# storing data in the session |
| 15 |
$session->param('f_name', 'Sherzod'); |
| 16 |
# or |
| 17 |
$session->param(-name=>'l_name', -value=>'Ruzmetov'); |
| 18 |
|
| 19 |
# retrieving data |
| 20 |
my $f_name = $session->param('f_name'); |
| 21 |
# or |
| 22 |
my $l_name = $session->param(-name=>'l_name'); |
| 23 |
|
| 24 |
# clearing a certain session parameter |
| 25 |
$session->clear(["l_name", "f_name"]); |
| 26 |
|
| 27 |
# expire '_is_logged_in' flag after 10 idle minutes: |
| 28 |
$session->expire('is_logged_in', '+10m') |
| 29 |
|
| 30 |
# expire the session itself after 1 idle hour |
| 31 |
$session->expire('+1h'); |
| 32 |
|
| 33 |
# delete the session for good |
| 34 |
$session->delete(); |
| 35 |
|
| 36 |
DESCRIPTION |
| 37 |
CGI-Session is a Perl5 library that provides an easy, reliable and modular |
| 38 |
session management system across HTTP requests. Persistency is a key feature |
| 39 |
for such applications as shopping carts, login/authentication routines, and |
| 40 |
application that need to carry data across HTTP requests. CGI::Session does |
| 41 |
that and many more. |
| 42 |
|
| 43 |
COPYRIGHT |
| 44 |
Copyright (C) 2001-2005 Sherzod Ruzmetov <[email protected]>. All rights reserved. |
| 45 |
This library is free software. You can modify and or distribute it under the same |
| 46 |
terms as Perl itself. |
| 47 |
|
| 48 |
AUTHOR |
| 49 |
Sherzod Ruzmetov <[email protected]>, http://author.handalak.com/ |
| 50 |
|
| 51 |
SEE ALSO |
| 52 |
* CGI::Session::Tutorial - extended CGI::Session manual |
| 53 |
* RFC 2965 - "HTTP State Management Mechanism" found at |
| 54 |
ftp://ftp.isi.edu/in-notes/rfc2965.txt |
| 55 |
* CGI - standard CGI library |
| 56 |
* Apache::Session - another fine alternative to CGI::Session |
| 57 |
|