You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-user@tcl.apache.org by Ronnie Brunner <ro...@netcetera.ch> on 2009/09/29 13:55:21 UTC

Re: Regarding Google Analytics issue

Hi Manu

> I just got stuck in the same issue as you with the google analytics.
> 
> The cookie it generates have the value that consists of '=' sign,
> which is not parsed properly, and because of the same, our secured
> subdomain site doesn't work, and as soon as I delete the cookie, it
> starts working.

Are you talking about Websh? If so, please update to the latest
version (3.6.0b5), where this issue is solved.

If that is not possible for some reason, you can overwrite the
_getCookie proc of a cookiecontext (where yourContext is changed to
the name of your context) as follows:

web::cookiecontext yourContext
proc yourContext::_getCookie {id} {
    ::set cookie [web::request HTTP_COOKIE]
    foreach v [split $cookie ";"] {
        # get key and value: note: some cookies (e.g.. Google analytics)
        # also use = in the value, so a simple split with =; does 
        # not always work...
        set key [string trim [lindex [split $v =] 0]]
        set value [string trim [join [lrange [split $v =] 1 end] =]]
        lappend kvlist $key $value
    }
    # search for $datatag
    foreach {key value} $kvlist {
        if {[string compare $key $id] == 0} {
            return $value
        }
    }
    error "no matching cookie found"
}


> Could you kindly tell me what did you do to solve this issue.

And if you don't talk about Websh: make sure whatever pareses your
cookies properly splits at "," characters and then just takes the
everything before the first "=" as cookie name, the rest as value,
even if it contains "0" aswell...

hth
Ronnie
-- 
Ronnie Brunner | ronnie.brunner@netcetera.ch
phone +41-44-247 79 79 | fax +41-44-247 70 75
Netcetera AG | 8040 Zürich | Switzerland | http://netcetera.ch

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-user-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-user-help@tcl.apache.org