Forum: Ruby on Rails Cleaning session variables when going to another link of the website

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Ed3050ec0a96c03ef1304e7ad1ff46fb?d=identicon&s=25 The Neurochild (Guest)
on 2008-12-09 21:16
(Received via mailing list)
Hi there!

I wish to set my session variables to null when click on a link of my
Rails website. My major problem is this: when I click on a link and
then return to the previous view, my session variables still remain,
unless I click on a cleaning button where I set my variables to null
(nil) (via a method called action, set in the forms)

This is a problem when dealing with a lot of users. I type something
on a text field and when I click on the submit button, it saves on a
session variable and then it shows on the field as a preset value.
Then I click on a link of my website, and I suddenly have the idea of
returning to my previous view, via click a link. And instead of
erasing the value, it's still there. Unless I click on another button
to erase the value of the session variable, It's impossible to erase
it when going somewhere else.

I need help here. How do I clean those variables in that case? (When I
click to another link, not a button.)

An example of what I'm talking about is this: session[:variable]. I
can't erase it.


The Neurochild
This topic is locked and can not be replied to.