Skip to content

Instantly share code, notes, and snippets.

@joshuathayer
Created April 5, 2011 01:32
Show Gist options
  • Save joshuathayer/902857 to your computer and use it in GitHub Desktop.
Save joshuathayer/902857 to your computer and use it in GitHub Desktop.
demonstrate connect session ID as query param
# hit "new session" url, get a session object back which include a session id
params = urllib.urlencode({'email': 'example@example.com', 'password':'1234'});
f = urllib2.urlopen('http://127.0.0.1:8080/session', params)
ob = json.loads(f.read());
session_id = ob['data']['session_id']
# use that session to take other action
params = urllib.urlencode({'connect.sid': session_id });
f = urllib2.urlopen('http://127.0.0.1:8080/account_homepage?%s' % params)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment