Re: Reading a cookie



Jerim79 wrote:
I did try to find the answer to this before posting, so this isn't a
knee jerk reaction.

What I am trying to accomplish is to have a script that opens a
cookie, reads a value, and then use a switch/case to take action based
on that value in the cookie. I want to set the cookie manually, so I
don't need setcookie(). I see that in PHP it stores the cookie in
memory. Is there a way to have PHP just read a cookie from the desktop
machine? Does it have to set it first? Am I better off with Javascript
for this?

The situation is that we have 4 computers. We also have 4 different
types of specialty printers, each for a different function. We don't
know which computer will be hooked up to which printer, and they may
be switched out routinely. We are trying to develop a simple script
that reads the value of the cookie which tells it which printer to
print to and what to print. This way, we can easily switch computers
around as needed, and will only need to change the value in the cookie
to have it access the correct code so that it prints the correct
information in the correct format.


You can use a cookie for this. But here's a suggestion - have a password-protected admin page which sets the cookie. When they move the computer, they have to log into the admin page and tell it which printer to use.

This then sets the cookie, which is now available for the rest of your pages. Of course, you would want to ensure that cookies are not cleared when the browser shuts down - at least not for your site.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • IE dot bug - Sandblad advisory #7
    ... Initially reported to Microsoft about the dot bug vulnerability. ... Microsoft released patch: ... Files in the cookie directory are not treated as beeing in the ... Remote webpage can script in local zone" ...
    (Bugtraq)
  • Re: Parameter quires in Data access pages
    ... script code from the DAP that writes the cookie to the PC: ... This is the script that reads, writes, and deletes cookies on the PC: ... button on the DAP, and then navigates to the "show me" DAP: ... <MS ACCESS MVP> ...
    (microsoft.public.access.dataaccess.pages)
  • Re: Parameter quires in Data access pages
    ... "Ken Snell (MVP)" wrote: ... script code from the DAP that writes the cookie to the PC: ... This is the script that reads, writes, and deletes cookies on the PC: ...
    (microsoft.public.access.dataaccess.pages)
  • [NEWS] XSS Vulnerability in Major Websites (Hotmail, Yahoo and Excite)
    ... *.msn.com the cookie for the email service can be captured. ... XSS is in the 'article.asp' script on 'www.accesshollywood.msn.com'. ... The yahoo mail service uses a *.yahoo.com server, ...
    (Securiteam)
  • [ANN] Pythonutils updates - approx, approxClientproxy, caseless etc
    ... approx.py is a Python CGI proxy. ... Whilst it is not as fully developed as that script it has ... Fixed bug in cookie sending. ...
    (comp.lang.python)