Cookie problems: Writing to cookie isn't changing anything 
Author Message
 Cookie problems: Writing to cookie isn't changing anything

I've got as problem here trying to edit the contents of a cookie - my sites
cookie.

Essentially I'm capturing the usersID (a GUID) and a couple of other
snippets of info ... simple stuff. There are about 4 keys in all, but there
may be just the one.

If the user is logged in, then I capture thr GUID. If he logs out, then I
want to reset the GUID to all zeros (see code example below) which is
therefore an indication to the site that they are logged out or not
registered yet (it's a default GUID if you like).

Thing is, I want to 'reset' the GUID without resetting the other keys, hence
the cookie isn't deleted, I just want to edit the contents.

The code below, when placed in the logout.asp page, DOES NOT change the
users cookie("playerID") or ("memberID"). They remain unmodified.

If I change the expiry to date-1, that doesn't work either.

Is there a limit on reading/writing to a cookie from a page?

My current page structure Reads in the information and then performs the
following ... so, by reading it, have I made those values inaccessible to be
modified on the same page???

------------------------------
Sub resetCookies()
 Dim item

 Response.Cookies("KolyanaForums").Domain = "www.kolyana.com"
 Response.Cookies("KolyanaForums").Expires = Date + 365

 For Each item In Request.Cookies("KolyanaForums")
     Response.Cookies("KolyanaForums")(item) =
Request.Cookies("KolyanaForums")(item)
 Next

End Sub

Call resetCookies()
 Response.Cookies("KolyanaForums")("PlayerID") =
"{00000000-0000-0000-0000-000000000000}"
 Response.Cookies("KolyanaForums")("MemberID") = -1
------------------------------



Wed, 12 Jan 2005 23:53:30 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. problem with cookies("cookies").path

2. WebBrowser control doesn't write cookies properly???

3. Cookies - VB Reading Cookies Created by JavaScript

4. IIS 5.1 (Win XP) Setting Cookies via Response.Cookies collection problem

5. Why window.open isn't returning a handler I can do anything with

6. Jscript cookie doesn't write

7. cookies don't write

8. Can alert Cookie values, but can't document.write them

9. I'm trying to write a script (WSH) to delete my TIF/Cookies

10. COOKIE PROBLEM WITH 'IE6' AND FRAMESETS:

11. Com+ and writing cookies using the ASP Response object

12. Read/Write cookies with VB

 

 
Powered by phpBB® Forum Software