I am using the default Cookie-Based Session in Rails 2.0.
I have accumulated the bad practice of adding:
session[‘seen_announcement_’ + Date.today.to_s] = true
over the years.
No users have complained yet, but I am assuming that each user must have
hundreds of seen_announcement_XXXXX in their cookies
I would like to write a script to clean their sessions of those keys.
Yet, I am finding the following:
session is not Hash. I cannot use session.keys to list all the keys
in session. How would I do this? I would like to dump out a session then
sort through the keys and delete the proper ones.
session.delete actually deletes the entire session. There is no
method for deleting each key in a session.
Please help me on out this.
On the other hand, how does this work. Do all session variables get
submitted along with HTTP request each time a user loads a page? So this
means the more I store in session the slower a request takes?