Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
0c0565dd
Kaydet (Commit)
0c0565dd
authored
Kas 16, 2001
tarafından
Barry Warsaw
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Toughen up the security warnings a bit.
üst
5e17d207
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
libcookie.tex
Doc/lib/libcookie.tex
+13
-8
No files found.
Doc/lib/libcookie.tex
Dosyayı görüntüle @
0c0565dd
...
@@ -42,11 +42,10 @@ This class derives from \class{BaseCookie} and overrides
...
@@ -42,11 +42,10 @@ This class derives from \class{BaseCookie} and overrides
\method
{
value
_
decode()
}
and
\method
{
value
_
encode()
}
to be the
\method
{
value
_
decode()
}
and
\method
{
value
_
encode()
}
to be the
\function
{
pickle.loads()
}
and
\function
{
pickle.dumps()
}
.
\function
{
pickle.loads()
}
and
\function
{
pickle.dumps()
}
.
Do not use this class. Reading pickled values from a cookie is a
\strong
{
Do not use this class!
}
Reading pickled values from untrusted
security hole, as arbitrary client-code can be run on
cookie data is a huge security hole, as pickle strings can be crafted
\function
{
pickle.loads()
}
. It is supported for backwards
to cause arbitrary code to execute on your server. It is supported
compatibility.
for backwards compatibility only, and may eventually go away.
\end{classdesc}
\end{classdesc}
\begin{classdesc}
{
SmartCookie
}{
\optional
{
input
}}
\begin{classdesc}
{
SmartCookie
}{
\optional
{
input
}}
...
@@ -56,9 +55,17 @@ valid pickle, and otherwise the value itself. It overrides
...
@@ -56,9 +55,17 @@ valid pickle, and otherwise the value itself. It overrides
\method
{
value
_
encode()
}
to be
\function
{
pickle.dumps()
}
unless it is a
\method
{
value
_
encode()
}
to be
\function
{
pickle.dumps()
}
unless it is a
string, in which case it returns the value itself.
string, in which case it returns the value itself.
The same security warning from
\class
{
SerialCookie
}
applies here.
\strong
{
Note:
}
The same security warning from
\class
{
SerialCookie
}
applies here.
\end{classdesc}
\end{classdesc}
A further security note is warranted. For backwards compatibility,
the
\module
{
Cookie
}
module exports a class named
\class
{
Cookie
}
which
is just an alias for
\class
{
SmartCookie
}
. This is probably a mistake
and will likely be removed in a future version. You should not use
the
\class
{
Cookie
}
class in your applications, for the same reason why
you should not use the
\class
{
SerialCookie
}
class.
\begin{seealso}
\begin{seealso}
\seerfc
{
2109
}{
HTTP State Management Mechanism
}{
This is the state
\seerfc
{
2109
}{
HTTP State Management Mechanism
}{
This is the state
...
@@ -181,8 +188,6 @@ The following example demonstrates how to use the \module{Cookie} module.
...
@@ -181,8 +188,6 @@ The following example demonstrates how to use the \module{Cookie} module.
>>> C = Cookie.SimpleCookie()
>>> C = Cookie.SimpleCookie()
>>> C = Cookie.SerialCookie()
>>> C = Cookie.SerialCookie()
>>> C = Cookie.SmartCookie()
>>> C = Cookie.SmartCookie()
>>> C = Cookie.Cookie() # backwards-compatible alias for SmartCookie
>>> C = Cookie.SmartCookie()
>>> C["fig"] = "newton"
>>> C["fig"] = "newton"
>>> C["sugar"] = "wafer"
>>> C["sugar"] = "wafer"
>>> print C # generate HTTP headers
>>> print C # generate HTTP headers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment