I used to write in 2.6 but not with 3.3.1
Code:
#!/usr/bin/python3 
# coding=utf-8 

import cgitb; cgitb.enable() 
import cgi, os, sys 
from http import cookies 


# initialize cookie 
cookie = cookies.SimpleCookie( os.environ.get('HTTP_COOKIE') ) 
cookie.load( cookie ) 
nikos = cookie.get('nikos') 


# if visitor cookie does exist 
if nikos: 
        msg = "ΑΠΟ ΤΗΝ ΕΠΟΜΕΝΗ ΕΠΙΣΚΕΨΗ ΣΟΥ ΘΑ ΣΕ ΥΠΟΛΟΓΙΖΩ ΩΣ ΕΠΙΣΚΕΠΤΗ ΑΥΞΑΝΟΝΤΑΣ ΤΟΝ ΜΕΤΡΗΤΗ!" 
        cookie['nikos'] = 'admin' 
        cookie['nikos']['path'] = '/' 
        cookie['nikos']['expires'] = -1                #this cookie will expire now 
else: 
        msg = "ΑΠΟ ΔΩ ΚΑΙ ΣΤΟ ΕΞΗΣ ΔΕΝ ΣΕ ΕΙΔΑ, ΔΕΝ ΣΕ ΞΕΡΩ, ΔΕΝ ΣΕ ΑΚΟΥΣΑ! ΘΑ ΕΙΣΑΙ ΠΛΕΟΝ Ο ΑΟΡΑΤΟΣ ΕΠΙΣΚΕΠΤΗΣ!!" 
        cookie['nikos'] = 'admin' 
        cookie['nikos']['path'] = '/' 
        cookie['nikos']['expires'] = 60*60*24*30*12                #this cookie will expire in a year 


print ( "Content-type: text/html; charset=utf-8\n" ) 
print( cookie, msg ) 
sys.exit(0) 

ima getting internal server error.

Here is the live error log coming from Apacher when i request the webpage from browser:
Code:
==> /usr/local/apache/logs/error_log <== 
[Sun May 26 19:07:41 2013] [error] [client 46.12.46.11] suexec failure: could not open log file 
[Sun May 26 19:07:41 2013] [error] [client 46.12.46.11] fopen: Permission denied 
[Sun May 26 19:07:41 2013] [error] [client 46.12.46.11] fopen: Permission denied 
[Sun May 26 19:07:41 2013] [error] [client 46.12.46.11] Premature end of script headers: koukos.py 
[Sun May 26 19:07:41 2013] [error] [client 46.12.46.11] Premature end of script headers: koukos.py