config/initializers/secret_token.rb
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Your secret key for verifying the integrity of signed cookies.
If you change this key, all old signed cookies will become invalid.
Make sure the secret is at least 30 characters and all random,
no regular words or you'll be exposed to dictionary attacks.
Your secret key for verifying the integrity of signed cookies . If you change this key all old signed cookies will become invalid . Make sure the secret is at least 30 characters and all random no regular words or you ' ll be exposed to dictionary attacks .
def find_secure_token
  token_file = Rails.root.join('.secret')
  if File.exist? token_file
    File.read(token_file).chomp
  else
    token = SecureRandom.hex(64)
    File.write(token_file, token)
    token
  end
end
def find_secure_token token_file = Rails . root . join ( '.secret' ) if File . exist? token_file File . read ( token_file ) . chomp else token = SecureRandom . hex ( 64 ) File . write ( token_file , token ) token end end
Your secret key for verifying the integrity of signed cookies.
Your secret key for verifying the integrity of signed cookies .
# Use the existing token. # Generate a new token of 64 random hexadecimal characters and store it in token_file.