1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
4
<title>4.7.3 Examples</title>
5
<META NAME="description" CONTENT="4.7.3 Examples">
4
<link rel="STYLESHEET" href="modpython.css" type='text/css'>
5
<link rel="first" href="modpython.html" title='Mod_python Manual'>
6
<link rel='contents' href='contents.html' title="Contents">
7
<link rel='index' href='genindex.html' title='Index'>
8
<link rel='last' href='about.html' title='About this document...'>
9
<link rel='help' href='about.html' title='About this document...'>
10
<LINK REL="prev" href="pyapi-cookie-func.html">
11
<LINK REL="parent" href="pyapi-cookie.html">
12
<LINK REL="next" href="pyapi-sess.html">
13
<meta name='aesop' content='information'>
14
<META NAME="description" CONTENT="Examples">
6
15
<META NAME="keywords" CONTENT="modpython">
7
16
<META NAME="resource-type" CONTENT="document">
8
17
<META NAME="distribution" CONTENT="global">
9
<link rel="STYLESHEET" href="modpython.css">
10
<link rel="first" href="modpython.html">
11
<link rel="contents" href="contents.html" title="Contents">
12
<link rel="index" href="genindex.html" title="Index">
13
<LINK REL="previous" href="pyapi-cookie-func.html">
14
<LINK REL="up" href="pyapi-cookie.html">
15
<LINK REL="next" href="pyapi-sess.html">
18
<title>4.7.3 Examples</title>
18
21
<DIV CLASS="navigation">
19
22
<table align="center" width="100%" cellpadding="0" cellspacing="2">
21
<td><A href="pyapi-cookie-func.html"><img src="icons/previous.gif"
22
border="0" height="32"
23
alt="Previous Page" width="32"></A></td>
24
<td><A href="pyapi-cookie.html"><img src="icons/up.gif"
25
border="0" height="32"
26
alt="Up One Level" width="32"></A></td>
27
<td><A href="pyapi-sess.html"><img src="icons/next.gif"
28
border="0" height="32"
29
alt="Next Page" width="32"></A></td>
24
<td><a rel="prev" title="4.7.2 Functions"
25
href="pyapi-cookie-func.html"><img src='previous.gif'
26
border='0' height='32' alt='Previous Page' width='32'></A></td>
27
<td><a rel="parent" title="4.7 Cookie - HTTP"
28
href="pyapi-cookie.html"><img src='up.gif'
29
border='0' height='32' alt='Up One Level' width='32'></A></td>
30
<td><a rel="next" title="4.8 Session - Session"
31
href="pyapi-sess.html"><img src='next.gif'
32
border='0' height='32' alt='Next Page' width='32'></A></td>
30
33
<td align="center" width="100%">Mod_python Manual</td>
31
<td><A href="contents.html"><img src="icons/contents.gif"
32
border="0" height="32"
33
alt="Contents" width="32"></A></td>
34
<td><img src="icons/blank.gif"
35
border="0" height="32"
36
alt="" width="32"></td>
37
<td><A href="genindex.html"><img src="icons/index.gif"
38
border="0" height="32"
39
alt="Index" width="32"></A></td>
34
<td><a rel="contents" title="Table of Contents"
35
href="contents.html"><img src='contents.gif'
36
border='0' height='32' alt='Contents' width='32'></A></td>
37
<td><img src='blank.gif'
38
border='0' height='32' alt='' width='32'></td>
39
<td><a rel="index" title="Index"
40
href="genindex.html"><img src='index.gif'
41
border='0' height='32' alt='Index' width='32'></A></td>
41
<b class="navlabel">Previous:</b> <a class="sectref" href="pyapi-cookie-func.html">4.7.2 Functions</A>
42
<b class="navlabel">Up:</b> <a class="sectref" href="pyapi-cookie.html">4.7 Cookie - HTTP</A>
43
<b class="navlabel">Next:</b> <a class="sectref" href="pyapi-sess.html">4.8 Session - Session</A>
43
<b class="navlabel">Previous:</b>
44
<a class="sectref" rel="prev" href="pyapi-cookie-func.html">4.7.2 Functions</A>
45
<b class="navlabel">Up:</b>
46
<a class="sectref" rel="parent" href="pyapi-cookie.html">4.7 Cookie - HTTP</A>
47
<b class="navlabel">Next:</b>
48
<a class="sectref" rel="next" href="pyapi-sess.html">4.8 Session - Session</A>
46
51
<!--End of Navigation Panel-->
74
79
This example uses "<tt class="samp">secret007</tt>" as the secret for HMAC signature.
77
<dl><dd><pre class="verbatim">
82
<div class="verbatim"><pre>
78
83
from mod_python import apache, Cookie
82
cookies = Cookie.get_cookie(req, Cookie.MarshalCookie,
87
cookies = Cookie.get_cookies(req, Cookie.MarshalCookie,
83
88
secret='secret007')
84
89
if cookies.has_key('spam'):
85
90
spamcookie = cookies['spam']
111
116
<table align="center" width="100%" cellpadding="0" cellspacing="2">
113
<td><A href="pyapi-cookie-func.html"><img src="icons/previous.gif"
114
border="0" height="32"
115
alt="Previous Page" width="32"></A></td>
116
<td><A href="pyapi-cookie.html"><img src="icons/up.gif"
117
border="0" height="32"
118
alt="Up One Level" width="32"></A></td>
119
<td><A href="pyapi-sess.html"><img src="icons/next.gif"
120
border="0" height="32"
121
alt="Next Page" width="32"></A></td>
118
<td><a rel="prev" title="4.7.2 Functions"
119
rel="prev" title="4.7.2 Functions"
120
href="pyapi-cookie-func.html"><img src='previous.gif'
121
border='0' height='32' alt='Previous Page' width='32'></A></td>
122
<td><a rel="parent" title="4.7 Cookie - HTTP"
123
rel="parent" title="4.7 Cookie - HTTP"
124
href="pyapi-cookie.html"><img src='up.gif'
125
border='0' height='32' alt='Up One Level' width='32'></A></td>
126
<td><a rel="next" title="4.8 Session - Session"
127
rel="next" title="4.8 Session - Session"
128
href="pyapi-sess.html"><img src='next.gif'
129
border='0' height='32' alt='Next Page' width='32'></A></td>
122
130
<td align="center" width="100%">Mod_python Manual</td>
123
<td><A href="contents.html"><img src="icons/contents.gif"
124
border="0" height="32"
125
alt="Contents" width="32"></A></td>
126
<td><img src="icons/blank.gif"
127
border="0" height="32"
128
alt="" width="32"></td>
129
<td><A href="genindex.html"><img src="icons/index.gif"
130
border="0" height="32"
131
alt="Index" width="32"></A></td>
131
<td><a rel="contents" title="Table of Contents"
132
rel="contents" title="Table of Contents"
133
href="contents.html"><img src='contents.gif'
134
border='0' height='32' alt='Contents' width='32'></A></td>
135
<td><img src='blank.gif'
136
border='0' height='32' alt='' width='32'></td>
137
<td><a rel="index" title="Index"
138
rel="index" title="Index"
139
href="genindex.html"><img src='index.gif'
140
border='0' height='32' alt='Index' width='32'></A></td>
133
<b class="navlabel">Previous:</b> <a class="sectref" href="pyapi-cookie-func.html">4.7.2 Functions</A>
134
<b class="navlabel">Up:</b> <a class="sectref" href="pyapi-cookie.html">4.7 Cookie - HTTP</A>
135
<b class="navlabel">Next:</b> <a class="sectref" href="pyapi-sess.html">4.8 Session - Session</A>
142
<b class="navlabel">Previous:</b>
143
<a class="sectref" rel="prev" href="pyapi-cookie-func.html">4.7.2 Functions</A>
144
<b class="navlabel">Up:</b>
145
<a class="sectref" rel="parent" href="pyapi-cookie.html">4.7 Cookie - HTTP</A>
146
<b class="navlabel">Next:</b>
147
<a class="sectref" rel="next" href="pyapi-sess.html">4.8 Session - Session</A>
137
<span class="release-info">Release 3.1.3, documentation updated on February 17, 2004.</span>
149
<span class="release-info">Release 3.2.10, documentation updated on July 19, 2006.</span>
139
151
<!--End of Navigation Panel-->