[ic] CookieName directive fails

Bruno Cantieni bruno at digi-land.com
Wed Jul 27 13:34:54 EDT 2005


 

> -----Original Message-----
> From: interchange-users-bounces at icdevgroup.org 
> [mailto:interchange-users-bounces at icdevgroup.org] On Behalf 
> Of Jon Jensen
> Sent: July 22, 2005 12:01 PM
> To: interchange-users at icdevgroup.org
> Subject: Re: [ic] CookieName directive fails
> 
> On Fri, 22 Jul 2005, Bruno Cantieni wrote:
> 
> > I'm having trouble getting CookieName to work on a 
> "merchant network"
> > consisting of about 40 catalogs.
> [snip]
> > With the CookieName directive it would look like:
> > Variable    MERCHANT_ID        1001
> > .
> > .
> > Cookies Yes
> > CookieName	MV___MERCHANT_ID___SESSION_ID
> 
> I presume you have ParseVariables Yes before those directives, right?
> 
> I've not used CookieName before, but from looking at the code 
> is would appear that you need to also set a CookiePattern. 
> See Vend::Dispatch:
> 
>      elsif ($::Instance->{CookieName} and defined $CGI::cookie) {
>          $CGI::cookie =~ 
> m{$::Instance->{CookieName}=($Vend::Cfg->{CookiePattern})};
>          $seed = $sessionid = $1;
>          $::Instance->{ExternalCookie} = $sessionid || 1;
>          $Vend::CookieID = $Vend::Cookie = 1;
>      }
>      elsif (defined $CGI::cookie and
>           $CGI::cookie =~ /\bMV_SESSION_ID=(\w{8,32})
>                                  [:_] (
>                                      (   \d{1,3}\.   # An IP ADDRESS
>                                          \d{1,3}\.
>                                          \d{1,3}\.
>                                          \d{1,3})
>                                      # A user name or domain
>                                      |   
> ([A-Za-z0-9][-\@A-Za-z.0-9]+) )?
>                                      \b/x)
>      {
>          $sessionid = $1
>              unless defined $CGI::values{mv_pc} and 
> $CGI::values{mv_pc} eq 'RESET';
>          $CGI::cookiehost = $3;
>          $CGI::cookieuser = $4;
>          $Vend::CookieID = $Vend::Cookie = 1;
>      }
> 
> If you set CookieName, then a different code block is called 
> which requires a CookiePattern (a regular expression). If you 
> don't set CookieName, a hard-coded cookie pattern is used, in 
> the next block.
> 
> Interestingly, the $CGI::cookiehost and $CGI::cookieuser 
> won't be set if you use a custom CookieName, and the 
> mv_pc=RESET trick to clear your session for testing won't 
> work either. I think those could be considered bugs.
> 
> I'm interested to hear if setting CookiePattern fixes your problem.
> 
> HTH,
> Jon
[snip]

Thanks for the feedback on this, Jon.
I was under the impression that Config.pm provided a default value for this:
	['CookiePattern',	 'regex',     	     '[-\w:.]+'],
??
Bruno




More information about the interchange-users mailing list