hello
I have the following script:

----
from WebKit.Page import Page
class Hello(Page):
        def writeBody(self):
                self.writeln('Hello, world!')
                #self.response().setCookie('col', 'red')
                if self.response().hasCookie('col'):
                        c = self.response().cookie('col')
                        h = "<h1 style=\"color:%s\"> python is great</h1>" % 
(c.value())
                        self.writeln(h)
                else:
                        self.writeln("no cookie")
                        self.response().setCookie('col', 'blue')
----

the browser output is:
"Hello, world! no cookie "
when I reaload the page, the output stays the same.

when I uncomment the line before the "if" statement, then the output is

Hello, world! 
python is great

with the string "python is great" in red color.

maybe may understanding of cookies in wrong, but I thougth that
after reloading, the cookie should be set and the "if" should be true
and the cookie should have the value "blue"

when I look at 
$HOME/.netscape/cookies I see no such cookie.

maybe I am calling the wrong function.

please tell me, if my understanding is just wrong, or if I am using Webware 
incorrectly??

thanks in advance


markus


-- 
Markus Jais
http://www.mjais.de
[EMAIL PROTECTED]
The road goes ever on and on - Bilbo Baggins

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to