Session ID Search in Rails 3

How can I get the current session id in rails 3?

I tried the following with no luck:

session[:session_id] session['session_id'] session[:id] session['id'] session.id session.session_id 
+56
ruby ruby-on-rails session
Jan 28 '11 at 4:27
source share
4 answers

Have you tried the following?

 request.session_options[:id] 
+129
Jan 28 '11 at 4:57
source share

It also returns a session id:

 session[:session_id] 
+8
Aug 03 2018-12-12T00:
source share

I can't check it right now, but as far as I know, the session 'id' variable has changed from 'id' to 'session_id' to Rails 3, have you tried this? Hope this works for you.

+2
Jan 28 2018-11-11T00:
source share

If you need to see the data recorded in the session store for a given session identifier from the Rails console, you can:

 a = Rails.application.config.session_store.new(app, Rails.application.config.session_options) a.class # => ActionDispatch::Session::RedisStore a.get_session(ENV, '07319b2485be9ac4850664cd47cede38') # or a.find_session(ENV, '07319b2485be9ac4850664cd47cede38') 

app and ENV are installed when the rails console starts, you do not need to install these

you can get session_id through any browser plugin related to cookies or (cookie inspector, cookie manager, ...)

+2
Feb 10 '16 at 15:26
source share



All Articles