NAME

Egg::Model::Session::Base::FileCache - Session management by Cache::FileCache.

SYNOPSIS

  package MyApp::Model::Sesion;
  
  __PACKAGE__->config(
   filecache => {
     cache_root         => MyApp->path_to('cache'),
     namespace          => 'sessions',
     cache_depth        => 3,
     default_expires_in => (60* 60),
     },
   );
  
  __PACKAGE__->startup(
   Base::FileCache
   ID::SHA1
   Bind::Cookie
   );

DESCRIPTION

The session data is preserved by using Cache::FileCache.

And, 'Base::DBI' is added to startup of the component module generated with Egg::Helper::Model::Session. Default is this module.

There is no Store system component needing because Cache::FileCache can treat HASH well.

  __PACKAGE__->startup(
   Base::FileCache
   ID::SHA1
   Bind::Cookie
   );

CONFIGURATION

'filecache' key is set to config of the session component module.

  __PACKAGE__->config(
   filecache => {
    .......
    },
   );

All set items are passed to Cache::FileCache.

see Cache::FileCache.

METHODS

Because most of these methods is the one that Egg::Model::Session internally uses it, it is not necessary to usually consider it on the application side.

cache

The Cache::FileCache object is returned.

restore ([SESSION_ID])

The session data obtained by received SESSION_ID is returned.

When SESSION_ID is not obtained, it acquires it in 'Session_id' method.

insert ([SESSION_DATA], [SESSION_ID])

New session data is preserved.

SESSION_DATA is indispensable.

When SESSION_ID is not obtained, it acquires it in 'Session_id' method.

update ([SESSION_DATA], [SESSION_ID])

The same processing as 'insert' is done.

delete ([SESSION_ID])

The session data is deleted.

SESSION_ID is indispensable.

  $session->delete('abcdefghijkemn12345');

SEE ALSO

Egg::Release, Egg::Model::Session, Egg::Model::Session::Manager::Base, Egg::Model::Session::Manager::TieHash, Egg::Model, Cache::FileCache,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.