Sign the auth token cookie and make it httpOnly

This commit is contained in:
tms
2013-02-20 17:24:19 -05:00
parent e914222cb3
commit 5616fdc475
3 changed files with 4 additions and 4 deletions

View File

@@ -117,7 +117,7 @@ class ApplicationController < ActionController::Base
user.auth_token = SecureRandom.hex(16)
user.save!
end
cookies.permanent[:_t] = user.auth_token
cookies.permanent.signed[:_t] = { :value => user.auth_token, :httponly => true }
end
# This is odd, but it seems that in Rails `render json: obj` is about