Setting a cookie before Javascript Redirection

Posted by Jason on Stack Overflow See other posts from Stack Overflow or by Jason
Published on 2009-06-11T22:00:17Z Indexed on 2010/03/26 6:03 UTC
Read the original article Hit count: 439

Hello,

I have a Rails app where I set a set a session variable the moment a user lands on my site with the referer and the page they hit. Additionally, I have Google Optimizer sending traffic from my homepage to various landing pages. The problem is that I think Google Optimizer is sending users away before the cookie is set.

Is that even possible? I believe that the cookie is set from the HTTP Header, which must have fully loaded before Google's Javascript has even loaded.

Thanks, Jason

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about cookies