>>I agree that the cookie header manipulation is cumbersome.
>>
>>What I have done in these instances is to use STRTRAN to write the HTML cookie code into the template. You could use:
>>
lcWholeShebang=o.ExpandTemplate(lcPageName, lcContentType, llTemplateString, .T.)
>>lcWholeShebang=STRTRAN(lcWholeShebang,PlaceHolder,lcCookieString)
>>Response.Write(lcWholeShebang)
>>
>>In fact, I use this technique for everything ExpandTemplate does.
>
>Well, in fact, the technique I proposed won't work. ExpandTemplate() does write the header immediately. So, it is not available for string manipulation after. I can't change all the places I am calling ExplandTemplate() as this is the same situation on several projects. So, basically, we don't have a solution right now.
>
>So, that technique assumes we wrote our own header. Then at the end, Reponse.Write() will send it to the HTTP server. In that case, we have control to do string manipulation on the HTTP header section of the HTML code itself. But, not as it is right now.
Well, you've gotta consider a template as a thing that already has a header, footer and everything in between. It's quite different that constructing a page using the Response objects HTMLHeader and HTMLFooter (before I figured this out, I was generating two footers on every page).
Since the header's already in there, and you're already embedding VFP code into your templates, the consistent thing to do is to insert VFP expressions into the header as well - including the cookies.
An option I usually use when a user logs in (when I create the session cookie) is to generate a page using HTMLHeader, HTMLFooter and Response.Write - which simply contains a cookie and a 1 second redirect to the desired template (all this page says is 'Restoring Personalized Settings')
HTH
Michael
Kogo Michael Hogan
"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?
Ideate Web Site