Skip to content

Instantly share code, notes, and snippets.

@filippo
Last active December 20, 2015 11:08
Show Gist options
  • Save filippo/6120544 to your computer and use it in GitHub Desktop.
Save filippo/6120544 to your computer and use it in GitHub Desktop.
import Cookie
c = Cookie.SimpleCookie()
c.load('__atrfs={"dr":"http://example.org/?id=1"')
# I solved removing the add this cookies from the string before parsing
# It's an ugly hack but seems to work.
def sanitizeCookie(aCookie):
c = re.sub('\s?__atuvc.*?;', '', aCookie)
c = re.sub('\s?__at.*?};?', '', c)
return re.sub('\s?_at.*?};?', '', c)
#then call
c.load(sanitizeCookie(cooakieString))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment