473,386 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

VB - reproduce browser cookie list

pod
298 100+
Is there a way to list all the cookies that are attached to a browser?

I am trying to reproduce the browser cookie list and have search the internet for that script, I have tried some but to no avail...


I would really appreciate if someone could enlighten me on this

I ran the following code but it only shows me the cookie that it belongs to (localhost), and I know there are a lot more cookies that the localhost one:

Expand|Select|Wrap|Line Numbers
  1. For Each Key in Request.Cookies()
  2.  
  3.       tempvalue=trim(request.Cookies(Key))
  4.          response.write "request.Cookies(" & quote 
  5.          response.write Key & quote & ") "
  6.          response.write " =<br><B>" & tempvalue & "</b><p>" & vbcrlf
  7. Next
  8.  
Thanks,

P:oD
May 6 '08 #1
4 1411
jeffstl
432 Expert 256MB
I could be wrong about the following, so someone please correct me if I am.

I believe in run time when you are executing a request.cookies you are only accessing the cookies tied to that particular session of the user (Cookies your app created with response.cookie) Not ALL the cookies on that users machine.

If you need to be able to view all the cookies on that users machine you would need to probably use the File System Object and read the cookie files individually from C:\Documents and Settings\username\Cookies

Though I am not sure that will be accessible for all users depending on browser and PC.

If you are using Windows XP\IE you can browse to C:\Documents and Settings\username\Cookies to view the cookie files on your PC.
May 6 '08 #2
DrBunchman
979 Expert 512MB
As far as I know cookies are restricted by the domain that created them so you cannot access all the cookies on a client machine because most of them were created by other domains.

Out of interest, why would you want to do this?

Dr B
May 6 '08 #3
DrBunchman
979 Expert 512MB
If you need to be able to view all the cookies on that users machine you would need to probably use the File System Object and read the cookie files individually from C:\Documents and Settings\username\Cookies
Just a quick note after seeing Jeff's comments to say that you can only read the cookies folder of machines which are accessible from your server.

You cannot access a machine's file system through the client for obvious security reasons.

Dr B
May 6 '08 #4
pod
298 100+
Thank you for your replies

To answer your query Doc, I am developing a web application (mywebApp) that among other things opens up a browser to a website (aHelpSite) where I want to retrieve a specific record, (using and ID number in the URL query string). But the site requires a login and I have no control on the site.

So I wanted to detect if the user was already logged in (aHelpSite), i.e. see if there is a aHelpSite cookie.

I think I will keep it simple and warn the user to login into aHelpSite before using the link.
May 6 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Richard P | last post by:
I am experiencing some browser weirdness. My app uses session state to hide values I prefer to keep out of the querystring. I am testing to see what happens when cookies are fully disabled in IE...
3
by: Richard P | last post by:
I am experiencing some browser weirdness. My app uses session state to hide values I prefer to keep out of the querystring. I am testing to see what happens when cookies are fully disabled in IE...
6
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am thinking about doing this since I got several cases that some of our internal users open more than one browser at the same time from our server. When one of the transactions was not...
4
by: dk9 | last post by:
The Situation: I'm working in my browser at a secured site (https). At the same time I need my application to get and parse some urls from that same site. What I've tried: I've login with my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.