From c29fbd3c7aa6391e820f682a960968aab7a52d07 Mon Sep 17 00:00:00 2001 From: Genadi Samokovarov Date: Thu, 17 Dec 2015 11:30:30 +0100 Subject: ApplicationRecord documentation pass This is a pass over the documentation which fills the missing gaps of `ApplicationRecord`. [ci skip] --- guides/source/security.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source/security.md') diff --git a/guides/source/security.md b/guides/source/security.md index b301736c36..1d0e87d831 100644 --- a/guides/source/security.md +++ b/guides/source/security.md @@ -171,7 +171,7 @@ NOTE: _Sessions that never expire extend the time-frame for attacks such as cros One possibility is to set the expiry time-stamp of the cookie with the session id. However the client can edit cookies that are stored in the web browser so expiring sessions on the server is safer. Here is an example of how to _expire sessions in a database table_. Call `Session.sweep("20 minutes")` to expire sessions that were used longer than 20 minutes ago. ```ruby -class Session < ActiveRecord::Base +class Session < ApplicationRecord def self.sweep(time = 1.hour) if time.is_a?(String) time = time.split.inject { |count, unit| count.to_i.send(unit) } -- cgit v1.2.3