Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44111

Re: How to get JSON values and how to trace sessions??

References <c370e0e6-8100-4fa8-8eb6-81d5f622031a@googlegroups.com>
Date 2013-04-23 06:47 +1000
Subject Re: How to get JSON values and how to trace sessions??
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.937.1366663657.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Apr 23, 2013 at 6:09 AM,  <webmaster@terradon.nl> wrote:
> But now i am wondering how to trace sessions? it is needed for a multiplayer game, connected to a webserver. How do i trace a PHP-session? I suppose i have to save a cookie with the sessionID from the webserver? Is this possible with Python? Are their other ways to keep control over which players sends the gamedata?
>
> Secondly, can i handle JSON values? I know how to create them serverside, but how do i handle that response in python?

Python has a JSON module that should do what you want:
http://docs.python.org/3.3/library/json.html

I don't know the details of cookie handling in Python, but this looks
to be what you want:

http://docs.python.org/3.3/library/http.cookiejar.html#http.cookiejar.CookieJar

Tip: The Python docs can be searched very efficiently with a web
search (eg Google, Bing, DuckDuckGo, etc). Just type "python" and
whatever it is you want - chances are you'll get straight there.

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How to get JSON values and how to trace sessions?? webmaster@terradon.nl - 2013-04-22 13:09 -0700
  Re: How to get JSON values and how to trace sessions?? Chris Angelico <rosuav@gmail.com> - 2013-04-23 06:47 +1000
  Re: How to get JSON values and how to trace sessions?? Tim Roberts <timr@probo.com> - 2013-04-23 23:25 -0700
  Re: How to get JSON values and how to trace sessions?? Roozbeh <roozbeh73@gmail.com> - 2013-04-25 07:12 -0700

csiph-web