aboutsummaryrefslogtreecommitdiffstats
path: root/railties/doc/guides/source/actioncontroller_basics/session.txt
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-01-22 15:13:47 -0600
committerJoshua Peek <josh@joshpeek.com>2009-01-22 15:13:47 -0600
commitcc0b5fa9930dcc60914e21b518b3c54109243cfa (patch)
tree3b5c65d8d0329388730542093314028630b0945a /railties/doc/guides/source/actioncontroller_basics/session.txt
parente57cb2629ac4971a5dcb1cf8bb2f6d0509317928 (diff)
parentccda96093a3bf3fb360f7c6d61bbbf341b2ae034 (diff)
downloadrails-cc0b5fa9930dcc60914e21b518b3c54109243cfa.tar.gz
rails-cc0b5fa9930dcc60914e21b518b3c54109243cfa.tar.bz2
rails-cc0b5fa9930dcc60914e21b518b3c54109243cfa.zip
Merge branch 'master' into 3-0-unstable
Conflicts: ci/cruise_config.rb
Diffstat (limited to 'railties/doc/guides/source/actioncontroller_basics/session.txt')
-rw-r--r--railties/doc/guides/source/actioncontroller_basics/session.txt33
1 files changed, 1 insertions, 32 deletions
diff --git a/railties/doc/guides/source/actioncontroller_basics/session.txt b/railties/doc/guides/source/actioncontroller_basics/session.txt
index ae5f876777..24818fcb2d 100644
--- a/railties/doc/guides/source/actioncontroller_basics/session.txt
+++ b/railties/doc/guides/source/actioncontroller_basics/session.txt
@@ -21,42 +21,11 @@ If you need a different session storage mechanism, you can change it in the `con
config.action_controller.session_store = :active_record_store
------------------------------------------
-=== Disabling the Session ===
-
-Sometimes you don't need a session. In this case, you can turn it off to avoid the unnecessary overhead. To do this, use the `session` class method in your controller:
-
-[source, ruby]
-------------------------------------------
-class ApplicationController < ActionController::Base
- session :off
-end
-------------------------------------------
-
-You can also turn the session on or off for a single controller:
-
-[source, ruby]
-------------------------------------------
-# The session is turned off by default in ApplicationController, but we
-# want to turn it on for log in/out.
-class LoginsController < ActionController::Base
- session :on
-end
-------------------------------------------
-
-Or even for specified actions:
-
-[source, ruby]
-------------------------------------------
-class ProductsController < ActionController::Base
- session :on, :only => [:create, :update]
-end
-------------------------------------------
-
=== Accessing the Session ===
In your controller you can access the session through the `session` instance method.
-NOTE: There are two `session` methods, the class and the instance method. The class method which is described above is used to turn the session on and off while the instance method described below is used to access session values.
+NOTE: Sessions are lazily loaded. If you don't access sessions in your action's code, they will not be loaded. Hence you will never need to disable sessions, just not accessing them will do the job.
Session values are stored using key/value pairs like a hash: