FWIW, it's generally considered a bad idea to depend on javascript for essential functions (unless you're coding for an intranet environment where you know / have control over what browser and options people will be using). Is there some reason the cookie needs to be changed via javascript? I can't think of one: if it's a matter of changing it based on form input, you should use a server-side script to handle that, both because a lot of people surf with javascript disabled, and because javascript has to be viewable by the client to work, which could open up security problems, as someone has already pointed out.

The shorter answer is that whatever cookie is there will, under normal circumstances, be readable by your script, whether it's created by perl, javascript, or altered by the client in a text editor. :-)

IOW, this seems like a "can I use X to do Y" question, and if X = javascript, the answer is a very qualified "yes, but you may not want to do Y in that way."

BCE
--Your punctuation skills are insufficient!


In reply to Re: cookie question by BorgCopyeditor
in thread cookie question by hotshot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.