GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
HTTP::Session::Store::DBI(3) User Contributed Perl Documentation HTTP::Session::Store::DBI(3)

HTTP::Session::Store::DBI - store session data in DBI for HTTP::Session

    use HTTP::Session;
    
    my $session = HTTP::Session->new(
        store   => HTTP::Session::Store::DBI->new( {
            dbh => ["dbi:SQLite:dbname=xxx", '', '', {RaiseError => 1}]
        } ),
        state => ...,
        request => ...,
    );

store session data in DBI. read HTTP::Session for usage.

ArrayRef which passes to DBI->connect(@$_)

or Instance of DBI->connect

session expire time(in seconds)
the table name where session stores. default is 'session'
the session_id column name. default is 'sid'
the data column name. default is 'data'
the expires column name. default is 'expires'
default is '0.001'. because DBI do NOT delete expired data itself, we have code in sub delete

    if ( rand() < $self->clean_thres ) {
        my $time_now = time();
        $dbh->do(qq~DELETE FROM $sid_table WHERE expires < $time_now~);
    }
    

set it to 0 if we do NOT want it.

SQLite:

    CREATE TABLE session (
        sid          VARCHAR(32) PRIMARY KEY,
        data         TEXT,
        expires      INTEGER UNSIGNED NOT NULL,
        UNIQUE(sid)
    );

for internal use only

HTTP::Session, DBI

Fayland Lam, "<fayland at gmail.com>"

Copyright 2008 Fayland Lam, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

2008-12-12 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.