Last active
February 24, 2017 19:04
-
-
Save p1nox/5065268 to your computer and use it in GitHub Desktop.
Using Cookies.js and jquery.base64.js to parse a signed cookie generated by Rails into an JavaScript Object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... after succesful login | |
def set_current_user_cookie( user ) | |
client_side_user_obj = { id: user.id, email: user.email } | |
cookies.signed[:_application_alt_session] = client_side_user_obj.to_json | |
end | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment