Difference between revisions of "Design Specs: Session Cleanup"

From WormBaseWiki
Jump to navigationJump to search
Line 18: Line 18:
  
 
browser session will expire after 3600 second as set in the config.
 
browser session will expire after 3600 second as set in the config.
 +
 
logged in user session does not expire  
 
logged in user session does not expire  
  
Line 24: Line 25:
 
   scheduler.yml
 
   scheduler.yml
 
   ---
 
   ---
   - at  : '0 3 1 * *'
+
   - at  : '0 3 1 * *' #this will happen at 3am the first day of every month
 
     event : /cron/remove_sessions
 
     event : /cron/remove_sessions
 
</pre>
 
</pre>

Revision as of 16:13, 31 January 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 clean up expired sessions in a cron-like fashion

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