Is there an object to store something across the sessions?

Just like servlet context in java web development.
In rails 1.1.6, the latest version on, I can do like
create a model without database tables bar.rb

class Bar
def inc

and create a controller foo_controller.rb

class FooController < ApplicationController
def index

This works on different sessions or browsers.

But it doesn’t work with Rails 1.2rc1 ( Why?
Are there something changed in 1.2rc1?
How can I do the same thing in 1.2rc1?


@@ indicates an instance variable, not a session object.
if you wish to use session object, just define one by simply adding a
key and value to the session hash. ex.

session[:name] = “elad”
session[:user] = User.find_by_name(“elad”)

etc. etc.

hope this helps,

Hi, please read the AWDwRv2 on using sessions. One would never write
such code for web applications that need to maintain or share state
between sessions. Thus, this code would exhibit undesireable behavior
when used with the web development context.

Good luck,