Listing 3.2: Dynamically generating a secret token.

Because the sample application is shared as a public repository, it’s
important to update the so-called secret token used by Rails to protect
session variables so that it is dynamically generated rather than
hard-coded (Listing 3.2). (The code in Listing 3.2 is fairly advanced
for so early in the tutorial, but because it’s a potentially serious
security issue I feel it’s important to include it even at this early
stage.) Be sure to use the augmented .gitignore file from Listing 1.7 so
that the .secret key isn’t exposed in your repositor