Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
64 Digit Session ID for Rails
# config/initializers/01_session_security.rb
module SessionSecurity
def generate_sid
sid = SecureRandom.hex(32)
sid.encode!(Encoding::UTF_8)
sid
end
end
ActionDispatch::Session::AbstractStore.include SessionSecurity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.