Default Session Values

Hi

I am wondering if it is possible to have default session values set
please?
I have come across a post stating to add a before filter to the
ApplicationController, however this seems a bit inefficient to me. I am
looking for a more specific place to load up session variables where
they
will only be loaded once.

Thanks

On Sep 6, 8:11am, Tjad C. [email protected] wrote:

Hi

I am wondering if it is possible to have default session values set please?
I have come across a post stating to add a before filter to the
ApplicationController, however this seems a bit inefficient to me. I am
looking for a more specific place to load up session variables where they
will only be loaded once.

Why set them at all? you could define methods such as

def session_feature_x
session[:x] || ‘default’
end

Fred