After looking at the Turbogears book (p117) I have attempted to use
cookies to
carry a session preference; in this case the scale of the displayed
text.

The first time it is used in a session it works ok but attempts to
readjust
the preference do not succeed.

The cookie is set as follows:

        @expose( )
        def usability(self, scale='M'):
                #
                if ((scale=='L')or(scale=='M')or(scale=='S')):
                        cp.response.simple_cookie['scale'] = scale
                        cp.response.simple_cookie['scale']['path'] = '/'
                #
                # redirect to the homepage per role
                #
                raise tg.redirect('/index')

The cookie is gotten in a kid base template as follows:

        if cp.request.simple_cookie.has_key('scale'):
                scale = cp.request.simple_cookie['scale'].value
        else:
                scale = 'M'      # default

Have scoured this group and the wider net but cannot see the
(probably obvious) mistake.

Thanks in advance


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to