Bei einer internen Site (webserver) funktioniert das login nicht mit dem Internet Explorer. Wird die Intranetseite über die IP Adresse aufgerufen, erscheint die Meldung im Browser: Cookies are OK. Über URL erscheint die Meldung: Cookies are NOT working
Einstellungen der Cookies im IE 6 SP2 bringt keine Abhilfe. Es spielt auch keine Rolle, ob die Seite in Trusted Sites eingetragen ist oder nicht.
Im Firefox funktioniert URL wie auch mit der IP-Adresse. Da IE als Standardbrowser definiert ist, kann leider nicht auf Firefox gewechselt werden.
Script:
Code: Alles auswählen
#!/usr/bin/env python
"""\
This CGI script sets a cookie on first call. It then redirects to itself
with ?action=check appended to the URL, so that the script is advices to
check the existence of the cookie.
chris
"""
import cgitb; cgitb.enable()
import sys, os, cgi
from Cookie import SimpleCookie
# check the action key in the URL
fields = cgi.FieldStorage()
if fields.has_key('action'):
action = fields.getvalue('action')
else:
action = 'set'
# check for the cookie
try:
test = SimpleCookie(os.environ['HTTP_COOKIE'])['cookie_test'].value
except KeyError:
test = None
# do what's needed depending on action
if action == 'check':
print "Content-type: text/plain"
print
if test:
print "Cookies are OK"
else:
print "Cookies are NOT working"
elif action == 'set':
print "Status: 302 Moved Temporarily"
print "Location: /cgi-bin/cookietest.py?action=check"
print "Content-type: text/plain"
print "Set-Cookie: cookie_test=some_value"
print
print "Tried to set a cookie, reloading page for check..."
Besten Dank im Voraus für einen Tipp.