[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 225
  • Last Modified:

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
0
simongod
Asked:
simongod
  • 3
  • 3
1 Solution
 
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
 
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now