Cookies / CGI
Michal Wallace (sabren)
sabren at manifestation.com
Wed May 24 14:03:26 EDT 2000
On Wed, 24 May 2000, RS Solutions wrote:
> Hi,
>
> Is there a simple script somewhere I can look at that sends and retrieves
> cookies via CGI?
>
> I've looked at the cookie module but its not clear to me how that gets
> posted to the end-user.
if you use weblib (http://weblib.sourceforge.net/ - get the cvs version,
not the snapshot):
-----------------------
import weblib
## show cookies from the browser:
print "the cookies are:"
print "<ul>"
for c in weblib.request.cookie.keys():
print "<li><b>%s</b> - %s</li>", (c, weblib.request.cookie[c])
print "</ul>"
## set some new cookies:
weblib.response.setCookie("x", "this is x")
weblib.response.setCookie("y", "this is y")
Cheers,
- Michal
-------------------------------------------------------------------------
http://www.manifestation.com/ http://www.linkwatcher.com/metalog/
-------------------------------------------------------------------------
More information about the Python-list
mailing list