开发者

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

开发者 https://www.devze.com 2023-03-16 13:13 出处:网络
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)

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

精彩评论

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