It took me 2 days to sort out this bug using cookies with pylons and
javascript. It was driving me mad.

I could not understand why setting a cookie in a controller like this:

    response.set_cookie('key', request.params.get('value', None))

having url as

controller/action?value=123

resulted in this in javascript:

    document.write($.cookie('key'))

"123"

with quotes enclosed.

Also calling in javascript console:

    > $.cookie('key')
    '"123"'

I thought it was a bug in jquery.cookie plugin then I tried in pylons:

    response.set_cookie('key', str(request.params.get('value', None)))

then in javascript I got it right:

    > $.cookie('key')
    "123"

This is supposed to be a bug somwhere in pylons or its dependencies

Should I open an issue? If so, where?

Thanks for your support

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to