views:

70

answers:

1

is there another way to delete sessions variable? i was thinking of sessions = nil

+6  A: 

Setting a session value:

@session[:greeting] = "Hello world!"

Reading a session value:

@session[:greeting] # => "Hello world!"

Deleting a single session value:

@session.delete :greeting

Clearing an entire session:

reset_session
jessecurry
I've never seen @session as an instance variable, always just session[:key] (without the @ like a local variable). Is this the same thing?
Beerlington