Skip to content

Instantly share code, notes, and snippets.

@trueheart78
Created December 12, 2017 14:23
Show Gist options
  • Save trueheart78/784c8d003ed84ebccb3f6bb3e6f81e74 to your computer and use it in GitHub Desktop.
Save trueheart78/784c8d003ed84ebccb3f6bb3e6f81e74 to your computer and use it in GitHub Desktop.

Revisions

  1. trueheart78 created this gist Dec 12, 2017.
    11 changes: 11 additions & 0 deletions 01_session_security.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    # 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