Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/kotfu/docrails into kotfu…
Browse files Browse the repository at this point in the history
…-master
  • Loading branch information
Aditya Sanghi committed Nov 29, 2010
2 parents 2025775 + 1ef9ddd commit 6308f1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion railties/guides/source/security.textile
Expand Up @@ -166,7 +166,7 @@ end
The section about session fixation introduced the problem of maintained sessions. An attacker maintaining a session every five minutes can keep the session alive forever, although you are expiring sessions. A simple solution for this would be to add a created_at column to the sessions table. Now you can delete sessions that were created a long time ago. Use this line in the sweep method above:

<ruby>
delete_all "updated_at < '#{time.to_s(:db)}' OR
delete_all "updated_at < '#{time.ago.to_s(:db)}' OR
created_at < '#{2.days.ago.to_s(:db)}'"
</ruby>

Expand Down

0 comments on commit 6308f1f

Please sign in to comment.