Session data

I have a major headache.

I have a complete set of data from a database table and I have deleted
all of the contents from the table, DON’T ASK.

I need to recover the data.

The data is stored in the session hash and I have to retrieve it.

The problem is I cannot find a way to iterate through the session.
Trying “session.each do…” doesn’t work, neither does “session.keys”.

Any help out there for a DESPERATE final year student in a bit of a fix.

Humbly yours dave.

from the console

$ script/console

Marshal.load(Base64.decode64(ActiveRecord::Base.connection.select_one("select

  • from sessions where session_id = ‘’")[“data”]))

it should return a hash of all the data stored in the session.

hope that helps

Chris H. wrote:

You’re a superstar Chris. That pulled me out of hole.

But of course, that’s what the session table holds! Don’t know why I
didn’t see it. Doh!

Many many thanks,
Dave