<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1012374" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1012374</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/cgi-generating-javascript-cookie-code#comment-1071434</link>
    <description> &lt;p&gt;I try to do things client-side where I can - better for site performance especially if you can eliminate an SSI on every page!  The idea was that the CGI validates the user and sets javascript cookies including a unique session ID cookie which could not be pre-guessed.  Then any subsequent static page could pick up the user info with javascript and any subsequent CGI could check the session ID against it&#039;s list of current active ones before doing anything important.&lt;/p&gt;
&lt;p&gt;Any ideas where I can find code to do user logins so that any page on the site can pick that up?  Like this site ... but without using PHP.&lt;/p&gt;
&lt;p&gt;Thanks&lt;br /&gt;
Tim&lt;/p&gt;
 </description>
     <pubDate>Fri, 22 Sep 2000 13:42:00 +0000</pubDate>
 <dc:creator>tcranfield</dc:creator>
 <guid isPermaLink="false">comment 1071434 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/cgi-generating-javascript-cookie-code#comment-1071412</link>
    <description> &lt;p&gt;one more question...&lt;/p&gt;
&lt;p&gt;why are you using javascript cookies for user validation?&lt;br /&gt;
Can&#039;t that can be hacked fairly easy?&lt;/p&gt;
&lt;p&gt;IMO, you should use some server side validation... such as using SSI at the very top of every page to exec a CGI.  Then you can check the user.  If ok, return to page, if not, redirect to error 401 page [un-authorized].&lt;/p&gt;
 </description>
     <pubDate>Thu, 21 Sep 2000 07:01:14 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1071412 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/cgi-generating-javascript-cookie-code#comment-1071373</link>
    <description> &lt;p&gt;Hi Vincent / anyone else,&lt;/p&gt;
&lt;p&gt;Sorry if I&#039;m not making myself clear.  The perl script I listed was just a test to prove that the concept works (which it doesn&#039;t!).&lt;/p&gt;
&lt;p&gt;The static test page (1.html) works.  But when the CGI simply copies that same page to the output (so the browser gets the same thing), it doesn&#039;t work (the cookie doesn&#039;t get set).&lt;/p&gt;
&lt;p&gt;A browser sets a cookie when told to do so by some javascript inside HTML.  The browser should not care where the HTML/javascript came from - but it seems that if it came from a static page, then it will set the cookie - if it was exactly the same but came from a CGI generating the same page - then it won&#039;t.&lt;/p&gt;
&lt;p&gt;As far as I understand, perl cookies are different from javascript cookies - so I don&#039;t think that will help!&lt;/p&gt;
&lt;p&gt;Again thanks for any answers or help you can give me - much appreciated!&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;
 </description>
     <pubDate>Wed, 20 Sep 2000 16:58:22 +0000</pubDate>
 <dc:creator>tcranfield</dc:creator>
 <guid isPermaLink="false">comment 1071373 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/cgi-generating-javascript-cookie-code#comment-1071369</link>
    <description> &lt;p&gt;Hi tcranfield,&lt;/p&gt;
&lt;p&gt;  Again, I&#039;m no perl expert, but logic says your design is at fault.&lt;br /&gt;
  The cookie is set by the browser when 1.html is accessed, not by the page itself.  Your perl script is simply writing the contents of the html page.  If you want your perl script to write out session vars, you need to have it do so.  What it is presently doing is a simple file copy.&lt;/p&gt;
&lt;p&gt;Vinny&lt;/p&gt;
 </description>
     <pubDate>Wed, 20 Sep 2000 12:53:39 +0000</pubDate>
 <dc:creator>Vincent Puglia</dc:creator>
 <guid isPermaLink="false">comment 1071369 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/cgi-generating-javascript-cookie-code#comment-1071366</link>
    <description> &lt;p&gt;Hi guys,&lt;br /&gt;
I&#039;ll try to simplify it.  In a nutshell, the problem is as follows:&lt;/p&gt;
&lt;p&gt;- Browser receives a static HTML page containing javascript which sets a javascript cookie.  Cookie gets set fine and this can be seen by checking it even in other browser windows.&lt;/p&gt;
&lt;p&gt;- Browser receives exactly the same HTML (containing javascript) as before, but this time it&#039;s a CGI program which is generating it.  Now the cookie does not get set.&lt;/p&gt;
&lt;p&gt;Why???&lt;/p&gt;
&lt;p&gt;To put it in context, I am doing a login procedure.  User logs in, CGI program checks the username/password, if ok then it returns a page which sets certain user/session cookies - so that any subsequent pages can pick this up with javascript.&lt;/p&gt;
 </description>
     <pubDate>Wed, 20 Sep 2000 11:31:21 +0000</pubDate>
 <dc:creator>tcranfield</dc:creator>
 <guid isPermaLink="false">comment 1071366 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/cgi-generating-javascript-cookie-code#comment-1071363</link>
    <description> &lt;p&gt;im confused and know some perl, but i don&#039;t understand ur question.&lt;/p&gt;
 </description>
     <pubDate>Wed, 20 Sep 2000 04:00:30 +0000</pubDate>
 <dc:creator>fairhousing</dc:creator>
 <guid isPermaLink="false">comment 1071363 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/cgi-generating-javascript-cookie-code#comment-1071344</link>
    <description> &lt;p&gt;what is the purpose of this script?  There may be a better way of doing this.  [perhaps using perl cookies]&lt;/p&gt;
 </description>
     <pubDate>Tue, 19 Sep 2000 23:44:53 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1071344 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/html-css-and-javascript/cgi-generating-javascript-cookie-code#comment-1071337</link>
    <description> &lt;p&gt;Hi tcranfield,&lt;/p&gt;
&lt;p&gt;  My perl is not up to par and you might get a better response in the CGI forum.  However, my guess is the perl script is simply copying the page&#039;s contents and not executing it in any manner.  If I remember right, there is a &lt;a href=&quot;http://www.allaboutcookies.com&quot; class=&quot;bb-url&quot;&gt;http://www.allaboutcookies.com&lt;/a&gt; (or somesuch); they probably have a perl script you can study.&lt;/p&gt;
&lt;p&gt;Vinny&lt;/p&gt;
 </description>
     <pubDate>Tue, 19 Sep 2000 22:11:36 +0000</pubDate>
 <dc:creator>Vincent Puglia</dc:creator>
 <guid isPermaLink="false">comment 1071337 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
