开发者

How does Rails / Devise relate a session to a user?

I'm tinkering with Devise in Rails and storing sessions in MySQL (using the directive MyApp::Application.config.session_store :active_record_store in config/initializers/session_store.rb)

In my sessions table, I've got a session with a se开发者_如何学JAVAssion_id and data, both of which are unintelligible.

The session_id is more or less random, as explained here. I'm not sure what's in the data, since this is a dummy app for now; the only data to know about this user is that it is signed in.

What I'm trying to understand is: How does Rails or Devise relate this session to a user? There's no user_id column on a session (I assume for good reason).


Look in the request headers for a cookie matching your session_id.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜