Nie było działu python więc temat zakładam tu
Mam taki problem nie wiem jak zaijniclować cistaeczka w pythonie moją stronę wykonuję w cgi i teraz próbowałem juz różnych opcji zaijnicjowania ciasteczek, ale żadna nie działała to znaczy wiem że nie sa zainicjowane bo w ustaienaich przeglądarki nie ma.
Próbowałem czegoś takiego
import Cookie
def show_cookie(c):
for key, morsel in c
.iteritems
(): print ' value =', morsel
.value
print ' coded_value =', morsel
.coded_value
for name in morsel.keys():
if morsel[name]:
print ' %s = %s' % (name
, morsel
[name
])
c = Cookie.SimpleCookie()
# A cookie with a value that has to be encoded to fit into the header
#c['encoded_value_cookie'] = '"cookie_value"'
#c['encoded_value_cookie']['comment'] = 'Notice that this cookie value has escaped quotes'
# A cookie that only applies to part of a site
#c['restricted_cookie'] = 'cookie_value'
#c['restricted_cookie']['path'] = '/sub/path'
#c['restricted_cookie']['domain'] = 'PyMOTW'
#c['restricted_cookie']['secure'] = True
# A cookie that expires in 5 minutes
#c['with_max_age'] = 'expires in 5 minutes'
#c['with_max_age']['max-age'] = 300 # seconds
# A cookie that expires at a specific time
#c['expires_at_time'] = 'cookie_value'
#expires = datetime.datetime(2019, 2, 14, 18, 30, 14) + datetime.timedelta(hours=1)
#c['expires_at_time']['expires'] = datetime.datetime(2019, 2, 14, 18, 30, 14) + datetime.timedelta(hours=1) # Wdy, DD-Mon-YY HH:MM:SS GMT
show_cookie(c)
I nic nie daje.