Permalink
Browse files

Updated README

  • Loading branch information...
ayanko committed Dec 25, 2012
1 parent 1b35011 commit f0cf29e3f033ee905eb2a96a3fa1ac8f6cd68cd3
Showing with 15 additions and 12 deletions.
  1. +15 −12 README.md
View
@@ -24,23 +24,19 @@ Add to `Gemfile`:
gem 'rack_session_access'
-Add to `config/application.rb`
+Add RackSessionAccess middleware to rails middleware stack.
+Add the following in`config/environments/test.rb`:
- module MyRailsApplication
- class Application < Rails::Application
- config.middleware.use RackSessionAccess::Middleware if Rails.env.test?
- end
+ [MyRailsApp]::Application.configure do
+ ...
+ # Access to rack session
+ config.middleware.use RackSessionAccess::Middleware
+ ...
end
-*Note* Ensure you include rack_session_access middleware only for test environment
+*Note* Ensure you include rack_session_access middleware only for *test* environment
otherwise you will have security issue.
-If you use rspec you may prefer to inject middleware only for rspec tests:
-Put into `spec/spec_helper`:
-
- Rails.application.configure do
- config.middleware.use RackSessionAccess::Middleware
- end
## Using with Sinatra
@@ -92,6 +88,13 @@ Example:
end
end
+## Authlogic integration
+
+ page.set_rack_session("user_credentials" => @user.persistence_token)
+
+## Devise integration
+
+ page.set_rack_session("warden.user.user.key" => User.serialize_into_session(@user).unshift("User"))
## Notes

0 comments on commit f0cf29e

Please sign in to comment.