~ubuntu-branches/ubuntu/karmic/libapache2-mod-python/karmic-updates

« back to all changes in this revision

Viewing changes to doc-html/pyapi-cookie-example.html

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ozarowski
  • Date: 2007-02-21 18:24:29 UTC
  • mfrom: (1.1.8 feisty)
  • Revision ID: james.westby@ubuntu.com-20070221182429-9okop7e0qpi24l85
Tags: 3.2.10-4
* Added XS-Vcs-Svn field
* Removed "db_purge" part from libapache2-mod-python.postrm
  (dh_installdebconf is generating a rule that will not fail if debconf is
  already removed)
* Added initial Spanish debconf translation from Manuel Porras Peralta.
  (closes: #411235)
* Added initial Portuguese debconf translation from Pedro Ribeiro.
  (closes: #411742)
* Added initial Galician debconf translation from Jacobo Tarrio.
  (closes: #411831)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
2
<html>
3
3
<head>
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>
16
19
</head>
17
20
<body>
18
21
<DIV CLASS="navigation">
19
22
<table align="center" width="100%" cellpadding="0" cellspacing="2">
20
23
<tr>
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>
40
42
</tr></table>
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>
44
49
<br><hr>
45
50
</DIV>
46
51
<!--End of Navigation Panel-->
54
59
This example sets a simple cookie which expires in 300 seconds:
55
60
 
56
61
<P>
57
 
<dl><dd><pre class="verbatim">
 
62
<div class="verbatim"><pre>
58
63
from mod_python import Cookie, apache
59
64
import time
60
65
 
66
71
 
67
72
    req.write('This response contains a cookie!\n')
68
73
    return apache.OK
69
 
</pre></dl>
 
74
</pre></div>
70
75
 
71
76
<P>
72
77
This example checks for incoming marshal cookie and displays it to the
74
79
This example uses "<tt class="samp">secret007</tt>" as the secret for HMAC signature.
75
80
 
76
81
<P>
77
 
<dl><dd><pre class="verbatim">
 
82
<div class="verbatim"><pre>
78
83
from mod_python import apache, Cookie
79
84
 
80
85
def handler(req):
81
86
    
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']
102
107
        req.write('Spam cookie not found, but we just set one!\n')
103
108
 
104
109
    return apache.OK
105
 
</pre></dl>
 
110
</pre></div>
106
111
 
107
112
<P>
108
113
 
110
115
<p><hr>
111
116
<table align="center" width="100%" cellpadding="0" cellspacing="2">
112
117
<tr>
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>
132
141
</tr></table>
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>
136
148
<hr>
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>
138
150
</DIV>
139
151
<!--End of Navigation Panel-->
140
152