开发者

get session id from warden or devise

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 sessi开发者_JAVA百科on 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'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜