Thanks Simon... will give it a try...
wardeaux
"Simon Wallis" <> wrote in message
news

A77A2F8-94B8-4B49-96AD-...
> It is possible but tricky, I had it working some time ago in an old ASP
application. I can't remember all the necessary tricks, but try doing things
like making the cookie name all uppercase or all lowercase letters and is
only alphanumeric (ie., contains no characters that would get url-encoded).
Also try setting all properties such as domain, path, etc.
>
> It is definitely possible.
>
> Simon.
>
>
> "Wardeaux" wrote:
>
> > I set a cookie in my code behind:
> >
> > Dim cookieFocus As New HttpCookie("PMFocus")
> > cookieFocus.Value = "D"
> >
> > Response.Cookies.Add(cookieFocus)
> >
> > I read the cookie in my html page:
> > function doFocus(str)
> > { var allcookies = document.cookie;
> > var pos = allcookies.indexOf("PMFocus=");
> > var mydate = new Date();
> > mydate.setFullYear(2000);
> > alert(allcookies);
> > if (pos != -1)
> > {
> > var start = pos + 8;
> > var end = allcookies.indexOf(";",start);
> > if (end == -1) end = allcookies.length;
> > var Myvalue = allcookies.substring(start,end);
> > alert(Myvalue);
> > if (Myvalue == "D")
> > {
> > alert("Found Cookie");
> > document.all(str).focus();
> > }
> > }
> > document.cookie = "PMFocus=E"
> > alert("here");
> > }
> >
> > When I try to set the cookie to a new value it just creates new cookie
by
> > the same name...
> > and when I change the value from my codebehind, it doesn't change the
one
> > created by my clientside javascript
> > Any clues how to get them to work on the same cookie?
> >
> > MTIA
> > wardeaux
> >
> >
> >
> >