Uhh, no that is exactly wrong. Clients are expected to
ignore cookies that don't come from matching domains. If
you request a resource from xxx.yyyy.com then the server
that responds can set cookies for *.yyyy.com or xxx.yyyy.com
but nothing else. What you are mixing in is the
protection against you going to "http://www.xxx.com/"
and that page calling a resource from "http://www.eviladplace.com/ad/tracker"
and you picking up a cookie from a site you didn't even
know you visited.
All the domain parameter is for is setting the depth
into your own domain. That way a server at www.cs.xxx.edu
can set one cookie for all *.xxx.edu and another at just
*.cs.xxx.edu and one just for itself at www.cs.xxx.edu!
If I could set cookies in the netscape.com domain for
you from hostile.org you can be sure I would be... =)
LWP is most certainly the right answer tho! Look at
HTTP::Request's perldocs specifically
$you = new YOU;
honk() if $you->love(perl)
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.