I need to grab the session id for a user and use it preferably in a model.
Here's the gist:
1) I have a list of proposals. 2) Unregistered users can create proposals and their session id is saved to them. 3) When a user registers or logs in their session id should be matched with proposals. 4) Then their user id should be saved to the proposal as well.
I've thought about overriding Devise controllers or using Warden hooks within the rails application file but these solutions seem messy.
You can use the following in controllers or views:
session['session_id']
=> '69384476b67fa4c2d1e3cc340eb4e951'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With