Difference between revisions of "Design Specs: Session Cleanup"

From WormBaseWiki
Jump to navigationJump to search
(Created page with ' used Catalyst::Plugin::Scheduler to clean up expired sessions in a cron-like fashion')
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
= session storage =
  
 +
Session::Store::DBI
 +
<pre>
 +
  __PACKAGE__->config->{'Plugin::Session'} = {
 +
              expires  => 3600,
 +
      dbi_dbh  => 'Schema',
 +
      dbi_table => 'sessions',
 +
      dbi_id_field => 'id',
 +
      dbi_data_field => 'session_data',
 +
      dbi_expires_field => 'expires',
 +
  };
 +
</pre>
  
used Catalyst::Plugin::Scheduler to clean up expired sessions in a cron-like fashion
+
note: Catalyst::Plugin::Session::Store::DBIC does not compatible with Session::PerUser plugin.
 +
 
 +
=session cleanup=
 +
 
 +
browser session will expire after 3600 second as set in the config.
 +
 
 +
logged in user session does not expire
 +
 
 +
use Catalyst::Plugin::Scheduler to automatically clean up expired sessions in a cron-like fashion
 +
 
 +
this will run at 3am on the first day of every month
 +
<pre>
 +
  scheduler.yml
 +
  ---
 +
  - at  : '0 3 1 * *' 
 +
    event : /cron/remove_sessions
 +
</pre>
 +
 
 +
Note: the related user history information will also be deleted from database automatically during this cleanup

Latest revision as of 19:50, 1 February 2011

session storage

Session::Store::DBI

  __PACKAGE__->config->{'Plugin::Session'} = {
              expires   => 3600,
	      dbi_dbh   => 'Schema', 
	      dbi_table => 'sessions',
	      dbi_id_field => 'id',
	      dbi_data_field => 'session_data',
	      dbi_expires_field => 'expires',
  };

note: Catalyst::Plugin::Session::Store::DBIC does not compatible with Session::PerUser plugin.

session cleanup

browser session will expire after 3600 second as set in the config.

logged in user session does not expire

use Catalyst::Plugin::Scheduler to automatically clean up expired sessions in a cron-like fashion

this will run at 3am on the first day of every month
   scheduler.yml
   ---
  - at  : '0 3 1 * *'   
    event : /cron/remove_sessions

Note: the related user history information will also be deleted from database automatically during this cleanup