Skip to content

Instantly share code, notes, and snippets.

@iHiD
Created June 6, 2012 15:30
Show Gist options
  • Save iHiD/2882651 to your computer and use it in GitHub Desktop.
Save iHiD/2882651 to your computer and use it in GitHub Desktop.
How to Build A Secure Website With Ruby On Rails 6
# Authenticate user
@user = #...
# Destroy the existing session in case anyone is sharing it and
# create a new session that you know to be unique to the user.
reset_session
# Store the user's id as normal
session[:user_id] = @user.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment