I have read that the SSI script cannot use the cookie environment variable because the server runs the script without reference to the incoming cookie. In fact, I think I've verified this because I've tried to use it in my SSI and it took me a long time to work out why my script wasn't working. (I don't fully understand why this should be so - the cookie is sent to the server and so I would have thought that there ought to be a way for the SSI script to use what the server already knows).
OK, I've sussed this now. Although I read in 2 places on websites that you cannot set OR read a cookie within SSI, this has turned out to be false. You cannot set a cookie but you CAN read one quite happily. I am now doing it on my website. q.v. change currency functionality in the price tables on pages on www.mastersgames.com
For the record and in case this happens to anyone else, my error occurred when I was setting the cookie - I did not specify the path variable. Therefore it defaulted to "/cgi-bin", the location of the script doing the setting. Since my normal web pages are not in cgi-bin, the cookie was not passed to them when the browser requested a normal page.
As soon as I set the path variable to be explicitly "/", the cookie environment variable was available within the page and also within SSIs within that page.
A still pitiful but much less desperate monk.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.