From f99132663b2ceee56f6e02ada396a911e4e20da2 Mon Sep 17 00:00:00 2001 From: Rizwan Reza Date: Fri, 11 Jun 2010 13:30:35 +0430 Subject: Took out the domain option logic to cookies.rb. --- .../lib/action_dispatch/middleware/session/abstract_store.rb | 12 ------------ .../lib/action_dispatch/middleware/session/cookie_store.rb | 8 -------- 2 files changed, 20 deletions(-) (limited to 'actionpack/lib/action_dispatch/middleware/session') diff --git a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb index b03244d025..3e8d64b0c6 100644 --- a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb @@ -93,13 +93,6 @@ module ActionDispatch :cookie_only => true } - # This regular expression is used to split the levels of a domain: - # So www.example.co.uk gives: - # $1 => www. - # $2 => example - # $3 => co.uk - DOMAIN_REGEXP = /^(.*\.)*(.*)\.(...|...\...|....|..\...|..)$/ - def initialize(app, options = {}) @app = app @default_options = DEFAULT_OPTIONS.merge(options) @@ -129,11 +122,6 @@ module ActionDispatch cookie[:expires] = Time.now + options.delete(:expire_after) end - if options[:domain] == :all - env["HTTP_HOST"] =~ DOMAIN_REGEXP - options[:domain] = ".#{$2}.#{$3}" - end - request = ActionDispatch::Request.new(env) set_cookie(request, cookie.merge!(options)) end diff --git a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb index 0fc63d026f..92a86ee229 100644 --- a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb @@ -34,14 +34,6 @@ module ActionDispatch # integrity defaults to 'SHA1' but may be any digest provided by OpenSSL, # such as 'MD5', 'RIPEMD160', 'SHA256', etc. # - # * :domain: Restrict the session cookie to certain domain level. - # If you use a schema like www.example.com and wants to share session - # with user.example.com set :domain to :all - # - # :domain => nil # Does not sets cookie domain. (default) - # :domain => :all # Allow the cookie for the top most level - # domain and subdomains. - # # To generate a secret key for an existing application, run # "rake secret" and set the key in config/environment.rb. # -- cgit v1.2.3