TeTiRoss TeTiRoss - 7 months ago 7
Ruby Question

Get all data from session rails

During execution of the web app it stores values in the

session
.
I know that I can get value from it by
session[:some_value]
. But I need to get all the values from it, preferable in hash. Is there any way to do it? Thanks.

Answer

You can use a method to_hash

session.to_hash
Comments