From: lsiden <lsiden@gmail.com>
To: Rack Development <rack-devel@googlegroups.com>
Subject: getting a cookie to work
Date: Wed, 2 Jun 2010 22:46:08 -0700 (PDT) [thread overview]
Message-ID: <d1e7356c-8bff-4587-b0c2-4a3f528439cd@j9g2000vbp.googlegroups.com> (raw)
My Sinatra app sets a cookie whose value is 'myapp.heroku.com', then
redirects:
CALC_URL = 'http://localhost:4020/alc'
domain = ENV['URL'] || 'localhost'
logger.info "cookie domain=#{domain}"
response.set_cookie 'session_id', {
:value => session_id,
:domain => domain,
:path => '/',
}
redirect CALC_URL
Here is the log message:
INFO -- : cookie domain=myapp.heroku.com
But when I examine the cookie with Firebug, it's domain is
'.myapp.heroku.com', not 'myapp.heroku.com'. In other words,
something has added a dot in front of the domain. And when the app
makes an AJAX call to myapp.heroku.com, the cookie is not included,
and therefor it fails.
Can anyone tell me where the dot is coming from and what I need to do
so that the browser will send the cookie when it makes requests to
myapp.heroku.com?
reply other threads:[~2010-06-03 5:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://groups.google.com/group/rack-devel
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d1e7356c-8bff-4587-b0c2-4a3f528439cd@j9g2000vbp.googlegroups.com \
--to=rack-devel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).