openshift/rails-example — pull request #6 by fotioslindiakos (2012-06-08 15:41:53+00:00)
Title: Secure session

These initializers generate a secret_token and secret_key at application initialization time.[1]

They first look in the OPENSHIFT_DATA_DIR for stored values (from a previous startup). If not found, it will generate secure values, then store them in those files for later use.

I have included a unit test that I believe captures the possible scenarios.

1: Similar to a technique proposed for the worpress-example - https://github.com/openshift/wordpress-example/pull/3