<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1018570" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1018570</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/problems-cookie-script#comment-1109361</link>
    <description> &lt;p&gt;Most excellent!&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;Fred&lt;/p&gt;
 </description>
     <pubDate>Wed, 22 May 2002 15:00:58 +0000</pubDate>
 <dc:creator>fredman73</dc:creator>
 <guid isPermaLink="false">comment 1109361 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/problems-cookie-script#comment-1109273</link>
    <description> &lt;p&gt;Here&#039;s a couple quick functions for setting and retrieving a cookie value:&lt;/p&gt;
&lt;p&gt;function setcookie(name,value) {&lt;br /&gt;
  var today = new Date();&lt;br /&gt;
  var expires = new Date();&lt;br /&gt;
  expires.setTime(today.getTime() + 60*60*24*365);&lt;br /&gt;
  document.cookie = name + &quot;=&quot; + escape(value) + ((expires == null) ? &quot;&quot; :&lt;br /&gt;
(&quot;; expires=&quot; + expires.toGMTString()));&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;function getcookie(name,dfault) {&lt;br /&gt;
  var search = name + &quot;=&quot;;&lt;br /&gt;
  if (document.cookie.length &amp;gt; 0) {&lt;br /&gt;
    offset = document.cookie.indexOf(search);&lt;br /&gt;
    if (offset != -1) {&lt;br /&gt;
      offset += search.length;&lt;br /&gt;
      end = document.cookie.indexOf(&quot;;&quot;, offset);&lt;br /&gt;
      if (end == -1) {&lt;br /&gt;
        end = document.cookie.length;&lt;br /&gt;
      }&lt;br /&gt;
      return unescape(document.cookie.substring(offset,end));&lt;br /&gt;
    } else {   return dfault;&lt;br /&gt;
    }&lt;br /&gt;
  } else { return dfault;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;So, to set the cookie value you would call setcookie(&quot;KeyName&quot;,&quot;Value&quot;), and to retrieve it again, getcookie(&quot;KeyName&quot;)&lt;/p&gt;
 </description>
     <pubDate>Tue, 21 May 2002 21:57:47 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1109273 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/problems-cookie-script#comment-1109263</link>
    <description> &lt;p&gt;Thanks, Peter!&lt;/p&gt;
&lt;p&gt;I&#039;m a newbie when it comes to coding cookies.  If you&#039;d have an example code I could play with or use, I&#039;d be forever in your debt!&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Fred&lt;/p&gt;
 </description>
     <pubDate>Tue, 21 May 2002 18:18:22 +0000</pubDate>
 <dc:creator>fredman73</dc:creator>
 <guid isPermaLink="false">comment 1109263 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/problems-cookie-script#comment-1109262</link>
    <description> &lt;p&gt;Just add the following to the body tag:&lt;/p&gt;
&lt;p&gt;Onload=&quot;putCookie();&quot;&lt;/p&gt;
&lt;p&gt;then in the function replace this line:&lt;/p&gt;
&lt;p&gt;YouEntered=document.cf.cfd.value;&lt;/p&gt;
&lt;p&gt;with your variable, for example:&lt;/p&gt;
&lt;p&gt;var MyVariable = &#039;test&#039;;&lt;/p&gt;
&lt;p&gt;YouEntered=MyVariable;&lt;/p&gt;
&lt;p&gt;That should do it.&lt;/p&gt;
 </description>
     <pubDate>Tue, 21 May 2002 17:17:32 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1109262 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/problems-cookie-script#comment-1109250</link>
    <description> &lt;p&gt;Thanks, Jack!&lt;/p&gt;
&lt;p&gt;Unfortunately the code on that page includes a form so the user actually activates the cookie.  WhatI need to do is set the cookie without the user having to see or do anything.  Is there a way of taking out the code that uses the prompts to achieve this?&lt;/p&gt;
&lt;p&gt;Cheers &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Fred&lt;/p&gt;
 </description>
     <pubDate>Tue, 21 May 2002 14:22:16 +0000</pubDate>
 <dc:creator>fredman73</dc:creator>
 <guid isPermaLink="false">comment 1109250 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/problems-cookie-script#comment-1109249</link>
    <description> &lt;p&gt;This helped me setting cookies:&lt;br /&gt;
&lt;a href=&quot;http://www.htmlgoodies.com/beyond/cookie.html&quot; class=&quot;bb-url&quot;&gt;http://www.htmlgoodies.com/beyond/cookie.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope it helps,&lt;/p&gt;
 </description>
     <pubDate>Tue, 21 May 2002 14:19:39 +0000</pubDate>
 <dc:creator>Jack Michaelson</dc:creator>
 <guid isPermaLink="false">comment 1109249 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
