report on cookie contents to server

i am not sure if this would fall under javascript programming or not, any language is prefered as long as it can be done.  i want to check the contents of a cookie stored on a users pc and then report the contents of that cookie to a website that can display its info.  any ideas on how this might be accomplished
LVL 2
simongodAsked:
Who is Participating?
 
Anubis2005Commented:
This is written in VB script also, but it's easy to convert to JavaScript...  Hope it helps.

http://www.w3schools.com/asp/asp_cookies.asp
0
 
GawaiCommented:
u are looking for this :

Sub ShowCookies()
      Dim cookie, key
            For Each cookie In Request.Cookies
                  If Not Request.Cookies(cookie).HasKeys Then
                          Response.Write cookie & " = " & _
                        Request.Cookies(cookie) & "<br>"
                  Else
                        For      Each key In Request.Cookies(cookie)
                              Response.Write cookie
                              Response.Write "(" & key & ")"
                              Response.Write " = "
                              Response.Write Request.Cookies(cookie)(key)
                              Response.Write "<br>" & vbCrLf
                        Next
                  End If
            Next
End Sub
0
 
simongodAuthor Commented:
maybe i should expand on that i little more, when someone goes to my website i want to check that cookie on there pc and then report its contents.  i am not very good with vb, i prefer c++ or javascript.  i can understand vb and could rewrite its code into vc++ exquivelant
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
simongodAuthor Commented:
can i refer to a cookie's filename?  another website stores a cookie and thats the one that i want to reference.
0
 
Anubis2005Commented:
Cookies are only accessible on the domain that they are created from, you cannot access other sites cookies...

For example, if you create a cookie for the domain xyz.com you would not be able to access it from zyx.com.  This is a security mechanizim built into each browser which supports cookies.   You can however configure a cookie created a beta.xyz.com to be able to be ready by xyz.com by altering the 'domain' setting of the cookie.
0
 
simongodAuthor Commented:
what if the domain is the same?  for instance, i use a free web hosting service that others can use too.  write to a cookie and another users "web site"  writes to a cookie can i access that cookies data?  we are both on the same domain, such as geocities.com
0
 
Anubis2005Commented:
Hmm... It should technically be accessible, however you would need to ensure that the 'Domain' portion of the cookie is set to only the 'geocities.com' namespace and the 'Path' is set to '/'.  This should potentially allow the cookie to be read from all sub-sites within GeoCities.

For further info, please see: http://wp.netscape.com/newsref/std/cookie_spec.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.