Created
April 5, 2011 01:32
-
-
Save joshuathayer/902857 to your computer and use it in GitHub Desktop.
demonstrate connect session ID as query param
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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