Accessing cookie(s) from server's onConnect method.

#1

I’m using the latest Autobahn asynchio web sockets and in my server’s custom onConnect method I want to get access to a cookie that was set prior at login.

Given an entry of “cookie”: “userdata={“id”: “8d07213112ba”, \”opt\”: “ad5c71e9e9b7”, “username”: \”User\”}” within my request header how can I extract this as a dictionary item?

I have tried to use json.loads and json.dumps to convert it but it always remains a string. I suspect it is down to my lack of experience with Python (3.5.1) but as what I am doing appears to be correct based on what I have read I’m a bit confused to say the least.

So I would really appreciate your help.

0 Likes