John Drago > Apache2-ASP-2.46 > Apache2::ASP::SessionStateManager

Download:
Apache2-ASP-2.46.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  2
View/Report Bugs
Source  

NAME ^

Apache2::ASP::SessionStateManager - Base class for Session State Managers.

SYNOPSIS ^

Within your ASP script:

  <%
    $Session->{counter}++;
    $Response->Write("You have viewed this page $Session->{counter} times.");
  %>

DESCRIPTION ^

The global $Session object is an instance of Apache2::ASP::SessionStateManager or one of its subclasses.

It is a blessed hash that is persisted to a database. Use it to share information across all requests for one user.

NOTE: - do not store database connections or filehandles within the $Session object because they cannot be shared across different processes or threads.

METHODS ^

save( )

Stores the Session object in the database. Returns true.

CONFIGURATION ^

XML Config

The file apache2-asp-config.xml should contain a section like the following:

  <?xml version="1.0"?>
  <config>
    ...
    <data_connections>
      ...
      <session>
        <manager>Apache2::ASP::SessionStateManager::MySQL</manager>
        <cookie_name>session-id</cookie_name>
        <cookie_domain>.example.com</cookie_domain>
        <dsn>DBI:mysql:dbname:localhost</dsn>
        <username>sa</username>
        <password>s3cr3t!</password>
        <session_timeout>30</session_timeout>
      </session>
      ...
    </data_connections>
    ...
  </config>

Database Storage

The database named in the XML config file should contain a table like the following:

  CREATE TABLE  asp_sessions (
    session_id    char(32) NOT NULL,
    session_data  blob,
    created_on    datetime default NULL,
    modified_on   datetime default NULL,
    PRIMARY KEY  (session_id)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1

BUGS ^

It's possible that some bugs have found their way into this release.

Use RT http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache2-ASP to submit bug reports.

HOMEPAGE ^

Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.

AUTHOR ^

John Drago <jdrago_999@yahoo.com>

COPYRIGHT AND LICENSE ^

Copyright 2007 John Drago, All rights reserved.

This software is free software. It may be used and distributed under the same terms as Perl itself.

syntax highlighting: