WordType Designs
Driven To Distractions©
The Sound of One Hand Clapping©


A rchive Date
[ 10-06-2000 ]
Category
[ Information Technologies ]
sub-Categoy
[ Networking ]

      [Retrieving cookies with PERL

      On platforms that support the environment variable $ENV{'HTTP_COOKIE'} (such as Solaris), cookies can be read into PERL with that environment variable.

      As with JavaScript, the returned value is valid name-value pairs for this document, separated by semicolons. Again, it is simpler to write a parsing routine for this header:

      @nvpairs=split(/; /, $ENV{'HTTP_COOKIE'});
      foreach $pair (@nvpairs) {
      ($name, $value) = split(/=/, $pair);
      $cookie{$name} = $value;
      }
      A call would be like:
      $myVar = $cookie{'foo'};

      Here, myVar would equal bar.

      5.4 Retrieving cookies with LiveWire

      To retrieve cookies into LiveWire, again use the client object. Any cookies headed with the prefix NETSCAPE_LIVEWIRE will be made into methods of the client object. Thus, any methods on the client object that have not expired from the previous session will still be available.

      myVar = client.foo;

      Here, myVar would equal bar.

      5.5 Retrieving cookies with Active Server Pages

      To retrieve cookies into ASP, use the Request.Cookies object. All the cookies valid for this document are pre-parsed into this object for you for quick and easy access.

      So, all you need to do to access a value is simply write:


      myVar = Request.Cookies("foo")


      Again, myVar equals bar. ]


Some pages may require Adobe Acrobat Reader



Copyright and Fair Use Information: The contents of this web site is protected by international copyright laws and may not be reproduced in any form or manner whatsoever, if for the purpose of resale or solicitation of a donation. The essays included here, may be reproduced only if: 1)They are not altered in any way; 2) reproductions must be accompanied by this copyright page ; and 3) it is given freely and without charge.
Fair use: The fair use of copyrighted work, including such use by reproduction in copies or phonorecords or by any other means specified in above sections, for purposes such as criticism, comment, news reporting, teaching (including multiple copies for classroom use), scholarship, or research, is not an infringement of copyright. In determining whether the use made of a work in any particular case is fair use the factors to be considered include : (1) the purpose and character of the use, including whether the use is of a commercial nature or is for nonprofit educational purposes; (2) the nature of the copyrighted work; (3) the amount and substantiality of the portion used in relation to the copyrighted work as a whole, and; (4) the effect of the use upon the potential market value of the copyrighted work.

Home | About Narrative? |Contact
Copyright © 2025. All Rights Reserved
HAG122125 (1998 -2026)