Problem with cookie-based sessions

Having just switched to cookie-based sessions, I find that the
action_controller/session/cookie_store.rb methods are not marshalling/
unmarshalling my session data correctly.

Apparently the cookie has some escaped characters “%0A&” that cause a
line break.

When unmarshal is called on the cookie it only sees the part up until
those characters, when it is expecting to get the entire string which
includes the “–” placed there by the code in marshal, I guess because
of the “first” command in read cookie:

Read the session data cookie.

def read_cookie
  @session.cgi.cookies[@cookie_options['name']].first
end

I’ve put up a pastie of the debug code and the cookies being set at
http://pastie.caboo.se/42076/

If anyone has any ideas or solutions, I’d be much obliged.

John Devine

Never mind – I was too hasty in edge. This was fixed by changeset
6200. Thanks Bitsweat!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs