Cookies
am 06.05.2005 07:05:12 von webmaster
Does anyone have any advice on using cookies with Perl? The documentation
that comes with OptiPerl doesn't even mention them, though there is an
example program that I can best describe as 'quirky'. It gets me so far, but
now I'm stuck.
Ken Down
--
================ ARCHAEOLOGICAL DIGGINGS ===============
| Australia's premiere archaeological magazine |
| http://www.diggingsonline.com |
========================================================
Re: Cookies
am 08.05.2005 10:06:56 von Dave Cross
On Fri, 06 May 2005 06:05:12 +0100, Kendall K. Down wrote:
> Does anyone have any advice on using cookies with Perl? The documentation
> that comes with OptiPerl doesn't even mention them, though there is an
> example program that I can best describe as 'quirky'. It gets me so far, but
> now I'm stuck.
I have no idea what "OptiPerl" is but if (as it should) it contains the
full Perl documentation set then it will include the documentation for the
CGI module which includes functions for reading and writing cookies. See
"perldoc CGI" for details.
Also the first half of my article at http://mag-sol.com/Articles/cgi3.html
covers the use of cookies.
Dave...
Re: Cookies
am 08.05.2005 20:36:51 von webmaster
In message
Dave Cross wrote:
> I have no idea what "OptiPerl" is but if (as it should) it contains the
> full Perl documentation set then it will include the documentation for the
> CGI module which includes functions for reading and writing cookies. See
> "perldoc CGI" for details.
Thanks. OptiPerl is a program that allows you to program in Perl. It has a
lot of files called "Perl Documentation" but the index doesn't list the word
"cookie", which is discouraging.
> Also the first half of my article at http://mag-sol.com/Articles/cgi3.html
> covers the use of cookies.
Thanks. I'll look it up.
Ken Down
--
================ ARCHAEOLOGICAL DIGGINGS ===============
| Australia's premiere archaeological magazine |
| http://www.diggingsonline.com |
========================================================
Re: Cookies
am 09.05.2005 19:00:11 von Jim Gibson
In article <5f74f5674d.diggings@diggingsonline.com>, Kendall K. Down
wrote:
> Thanks. OptiPerl is a program that allows you to program in Perl. It has a
> lot of files called "Perl Documentation" but the index doesn't list the word
> "cookie", which is discouraging.
>
Don't be discouraged. Cookies is an HTTP mechanism and has nothing to
do with Perl. Therefore, it is not part of Perl's core implementation,
but it addressed by Perl CGI modules, such as CGI.pm. While Perl is
used by many for CGI programming, Perl is not CGI. Perl is used for
many non-CGI purposes, and many CGI programs are not written in Perl.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Re: Cookies
am 09.05.2005 21:53:59 von webmaster
In message <090520051000112356%jgibson@mail.arc.nasa.gov>
Jim Gibson wrote:
> Don't be discouraged. Cookies is an HTTP mechanism and has nothing to
> do with Perl. Therefore, it is not part of Perl's core implementation,
> but it addressed by Perl CGI modules, such as CGI.pm. While Perl is
> used by many for CGI programming, Perl is not CGI. Perl is used for
> many non-CGI purposes, and many CGI programs are not written in Perl.
You're just trying to confuse me, you are.
Yes, I have discovered much of the above through banging my head against the
brick wall of perl programming.
What has confused me more than somewhat is that just as an experiment I
tried loading the cookie into Notepad and altering it and then reading it
with the sample cookie program OptiPerl provided. Nothing happened; it
continued to load the old information. I hunted around and found a second
incarnation of the cookie, so made sure that both were altered in the same
way - and still it continued to load the old information (which I presume it
was getting from some cache somewhere).
How does the cookie loading program know what the cookie is called and how
does it know which one to read?
Ken Down
--
================ ARCHAEOLOGICAL DIGGINGS ===============
| Australia's premiere archaeological magazine |
| http://www.diggingsonline.com |
========================================================
Re: Cookies
am 10.05.2005 20:29:34 von Jim Gibson
In article <5e5a80684d.diggings@diggingsonline.com>, Kendall K. Down
wrote:
> In message <090520051000112356%jgibson@mail.arc.nasa.gov>
> Jim Gibson wrote:
>
> > Don't be discouraged. Cookies is an HTTP mechanism and has nothing to
> > do with Perl. Therefore, it is not part of Perl's core implementation,
> > but it addressed by Perl CGI modules, such as CGI.pm. While Perl is
> > used by many for CGI programming, Perl is not CGI. Perl is used for
> > many non-CGI purposes, and many CGI programs are not written in Perl.
>
> You're just trying to confuse me, you are.
>
> Yes, I have discovered much of the above through banging my head against the
> brick wall of perl programming.
>
> What has confused me more than somewhat is that just as an experiment I
> tried loading the cookie into Notepad and altering it and then reading it
> with the sample cookie program OptiPerl provided. Nothing happened; it
> continued to load the old information. I hunted around and found a second
> incarnation of the cookie, so made sure that both were altered in the same
> way - and still it continued to load the old information (which I presume it
> was getting from some cache somewhere).
>
> How does the cookie loading program know what the cookie is called and how
> does it know which one to read?
The "cookie loading program" is normally a web browser (unless you are
talking about a web server). A cookie has a name, a value, an
expiration date, a domain, a path, and a "secure" status, some of which
are optional. See, for example,
for details
(which I found by Googling 'HTTP cookie') or any reference on the HTTP
protocol.
A web server sends a cookie to a browser as part of the HTTP header of
a downloaded response page in a 'Set-Cookie:' line. The browser is
expected to save the cookie and, if enabled by the user, transmit the
cookie as part of an HTTP request, also in the header in a 'Cookie:'
line.
The web server then parses the name:value pairs in the cookie and uses
them to customize the response, just like CGI request parameters. The
exact location on the user's system where the cookie is kept is up to
the browser. Which cookie to use is determined by the domain and path
information stored with the cookie. When requesting a URL, a browser
will look up the domain and path of the URL in it's cookie cache and
send a cookie it finds associated with that URL along with the HTTP
request.
This has nothing to do with Perl, by the way.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Re: Cookies
am 11.05.2005 07:48:30 von webmaster
In message <100520051129341069%jgibson@mail.arc.nasa.gov>
Jim Gibson wrote:
> The "cookie loading program" is normally a web browser (unless you are
> talking about a web server). A cookie has a name, a value, an
> expiration date, a domain, a path, and a "secure" status, some of which
> are optional. See, for example,
> for details
> (which I found by Googling 'HTTP cookie') or any reference on the HTTP
> protocol.
Thanks. The page has moved and is not found on this server, but I'll do my
own searching now that I know what to search for.
> A web server sends a cookie to a browser as part of the HTTP header of
> a downloaded response page in a 'Set-Cookie:' line. The browser is
> expected to save the cookie and, if enabled by the user, transmit the
> cookie as part of an HTTP request, also in the header in a 'Cookie:'
> line.
Thanks for the information.
> This has nothing to do with Perl, by the way.
Hmmmm. As I'm trying to write a Perl program that will write and read
cookies, for me it does have a lot to do with Perl - but I take your point.
Ken Down
--
================ ARCHAEOLOGICAL DIGGINGS ===============
| Australia's premiere archaeological magazine |
| http://www.diggingsonline.com |
========================================================