Permalink
Browse files

add aarrr.id workaround

  • Loading branch information...
1 parent 9e2e80a commit c08da1df75dfc28a461b0a930a62ce110b688e8e @jacquescrocker committed Jun 11, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/aarrr/session.rb
View
@@ -110,10 +110,12 @@ def parse_id(env_or_object)
# if it's a hash, then process like a request and pull out the cookie
if env_or_object.is_a?(Hash)
-
- request = Rack::Request.new(env_or_object)
- request.cookies[AARRR::Config.cookie_name]
-
+ if env_or_object["aarrr.id"]
+ env_or_object["aarrr.id"]
+ else
+ request = Rack::Request.new(env_or_object)
+ request.cookies[AARRR::Config.cookie_name]
+ end
# if it's a string
elsif env_or_object.is_a?(String)
env_or_object

0 comments on commit c08da1d

Please sign in to comment.