<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1022248" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1022248</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/staying-logged-cookie-expiringresetting-issue#comment-1137327</link>
    <description> &lt;p&gt;found it.&lt;br /&gt;
a friend asked me for the bgnpg() function inthe include file. pointed me to an extra character in a needed cookie value. when it was updating there was a slight error... probalby an accident from putting in the debugging stuff or something like that&lt;/p&gt;
 </description>
     <pubDate>Fri, 05 Sep 2003 19:58:29 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1137327 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/staying-logged-cookie-expiringresetting-issue#comment-1137323</link>
    <description> &lt;p&gt;i realized something... there&#039;s no debugging things in bgnpg();&lt;/p&gt;
&lt;p&gt;well... i added some debugging stuff and think i know what the problem is... the functions doesn&#039;t have one of two include files it needs.... so....while everything else was perfectly fine and executing properly....&lt;br /&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;Quote: this is the debug stuff from the bgnpg function&lt;br /&gt;
$_COOKIE[&#039;login&#039;]: 1&lt;br /&gt;
db: Resource id #1&lt;br /&gt;
fyd: 1&lt;br /&gt;
cookies (un -&amp;gt; pw): neo -&amp;gt; 9cc9e1f6a22e05307d6831087ef5d1e6&lt;br /&gt;
fprefs: Resource id #2&lt;br /&gt;
error num: 0&lt;br /&gt;
error:&lt;br /&gt;
fprefs rows: 1&lt;br /&gt;
gmto: -5.00&lt;br /&gt;
utds:&lt;br /&gt;
duration:&lt;br /&gt;
ims accepted: 1&lt;br /&gt;
uid: 1&lt;br /&gt;
now -&amp;gt; expire: 1062790733 -&amp;gt; expire 1062790733&lt;br /&gt;
active -&amp;gt; exp: 2003-09-05 19:38:53 -&amp;gt; 2003-09-05 19:38:53&lt;br /&gt;
update 1&lt;br /&gt;
affected rows -&amp;gt; error number: 1 -&amp;gt; 0&lt;br /&gt;
error:&lt;br /&gt;
ending of pgbgndebug crap&lt;/blockquote&gt;&lt;/p&gt;
&lt;p&gt;but.....that didn&#039;t fix it.&lt;br /&gt;
first page after login:&lt;br /&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;Quote: this is the debug stuff from the bgnpg function&lt;br /&gt;
$_COOKIE[&#039;login&#039;]: 1&lt;br /&gt;
db: Resource id #1&lt;br /&gt;
fyd: 1&lt;br /&gt;
cookies (un -&amp;gt; pw): neo -&amp;gt; 9cc9e1f6a22e05307d6831087ef5d1e6&lt;br /&gt;
fprefs: Resource id #2&lt;br /&gt;
error num: 0&lt;br /&gt;
error:&lt;br /&gt;
fprefs rows: 1&lt;br /&gt;
gmto: -5.00&lt;br /&gt;
utds: m/d/Y H:i:s&lt;br /&gt;
duration: 60&lt;br /&gt;
ims accepted: 1&lt;br /&gt;
uid: 1&lt;br /&gt;
now -&amp;gt; expire: 1062791587 -&amp;gt; expire 1062795187&lt;br /&gt;
active -&amp;gt; exp: 2003-09-05 19:53:07 -&amp;gt; 2003-09-05 20:53:07&lt;br /&gt;
update 1&lt;br /&gt;
affected rows -&amp;gt; error number: 1 -&amp;gt; 0&lt;br /&gt;
error:&lt;br /&gt;
ending of pgbgndebug crap&lt;/blockquote&gt;&lt;/p&gt;
&lt;p&gt;so it should be lasting an hour for me, right? (all times gmt)&lt;br /&gt;
yet... next pageload:&lt;br /&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;Quote: this is the debug stuff from the bgnpg function&lt;br /&gt;
$_COOKIE[&#039;login&#039;]: 0&lt;br /&gt;
ending of pgbgndebug crap&lt;/blockquote&gt;&lt;/p&gt;
&lt;p&gt; now i&#039;m really stumped.&lt;/p&gt;
 </description>
     <pubDate>Fri, 05 Sep 2003 19:38:55 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1137323 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/staying-logged-cookie-expiringresetting-issue#comment-1137315</link>
    <description> &lt;p&gt;suzanne: noted. i&#039;ll try to comment it better.&lt;/p&gt;
&lt;p&gt;mark: the only things in all the pages are what&#039;s Inside the section denoted as being from the include. the area you&#039;re telling has an issue with it being used as post is ONLY on the login page (after the functions from the included file)&lt;/p&gt;
&lt;p&gt;since Suzanne has a good point with people trying to hack the site, i&#039;ll combine the two. it will make the code more compact, between that and adding comments, maybe with the next update it will be easier to follow what&#039;s happening.&lt;/p&gt;
 </description>
     <pubDate>Fri, 05 Sep 2003 16:43:52 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1137315 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/staying-logged-cookie-expiringresetting-issue#comment-1137308</link>
    <description> &lt;p&gt;Please note how the white space, indents and comments make the script a LOT easier to read and understand? Good practice is something that helps everyone, especially the person needing help!&lt;/p&gt;
 </description>
     <pubDate>Fri, 05 Sep 2003 15:00:39 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1137308 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/staying-logged-cookie-expiringresetting-issue#comment-1137284</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: i hope the change makes things more clear.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Clear as mud.  I have no idea what I&#039;m looking at.&lt;br /&gt;
I have no idea how you&#039;re attempting to tracking users between pages.&lt;br /&gt;
I don&#039;t know what code is included where, or anything.&lt;/p&gt;
&lt;p&gt;I&#039;m assuming that the login.issue code is included on every page?&lt;br /&gt;
At any rate.  I still think that your not checking your cookie data.&lt;/p&gt;
&lt;p&gt;I&#039;ll re-write a section for you...&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;# variables used&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;MD5&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;pass&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$login&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$duration&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Login Page&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$error&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$gmto&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uid&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$linfo&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;br /&gt;if(isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;un&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;])){ &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;# check the db if this isn&#039;t the first loading of the page&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;un&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;# what was the passed username?&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_connect&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$host&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$login2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) or die(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;cannot access mysql\&quot;); # connect&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fyd&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_select_db(&#039;findyourdesire&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) or die(\&quot;cannot connect to db\&quot;); # select the db&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$lookup&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_query(\&quot;SELECT * FROM users WHERE username=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&amp;nbsp; if(mysql_num_rows(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$lookup&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)){ // we have a user (username is unique, it can only be 1 or 0 returned)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_fetch_array(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$lookup&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # get all the info associated with the user&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;==&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;password&#039;]){ # the passwords match&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sa&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;site_access&#039;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if((contains(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sa&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$regulars&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;))||(contains(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sa&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$desireds&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;))){ # you&#039;re not suspended&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$login&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=TRUE; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$duration&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;login_duration&#039;]; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;uid&#039;]; # set login, cookie duration, uid&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$gmto&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;gmt_offset&#039;]; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rtds&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;tds&#039;]; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$utds&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tds&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rtds&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;; # set the gmt offset &amp;amp; time display&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$now&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=gmdate(\&quot;Y-m-d H:i:s\&quot;, time()); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$currip&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;REMOTE_ADDR&#039;]; # get the new ip&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$update&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_query(\&quot;UPDATE users SET last_login_ip=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$currip&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;, last_login_date=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$now&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039; WHERE uid=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # update login date and ip&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$aff&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_affected_rows(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$errno&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_errno(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$error&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=mysql_error(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ll&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$durr&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$duration&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uts&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=time(); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$exp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=gmdate(\&quot;Y-m-d H:i:s\&quot;, (time()+(60*&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$durr&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$duration&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;))); // debugging stuff&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=time()+(60*&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$durr&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$duration&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # set expiration by formula time()+seconds*minutes*hrs*days*yrs&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setcookie(&#039;un&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # set username&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setcookie(&#039;pw&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # set password&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setcookie(&#039;login&#039;, 1, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # set login&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setcookie(&#039;gmto&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$gmto&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # set the gmt offset&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setcookie(&#039;utds&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$utds&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); # set the time display style&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$linfo&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;=\&quot;&amp;lt;p&amp;gt;debug:&amp;lt;br /&amp;gt;un:&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br /&amp;gt;gmto: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$gmto&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br /&amp;gt;tds: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rtds&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$utds&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br /&amp;gt;login length: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ll&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, exprire: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; / &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$exp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, now: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uts&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; / &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$now&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;update: UPDATE users SET last_login_ip=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$currip&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;, last_login_date=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$now&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039; WHERE uid=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$aff&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$errno&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$error&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;; // debugging stuff&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bgnpg(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); nav2(); success(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$linfo&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); clspg(); # show the successful login page&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }else{ bgnpg(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); nav(); login(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, TRUE, 3); clspg(); } # the user is suspended&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }else{ bgnpg(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); nav(); login(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, TRUE, 2); clspg(); } # the submitted password is wrong&lt;br /&gt;&amp;nbsp; }else{ bgnpg(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); nav(); login(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, TRUE, 1); clspg(); } # there was no user by that name&lt;br /&gt;}else{ bgnpg(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); nav(); login(&#039;&#039;, FALSE, 0); clspg(); } # no failed login attempt&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;becomes:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//&amp;nbsp; variables used&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$duration&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Login Page&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$error&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$linfo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;br /&gt;if(isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;un&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;])) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// check data from login form&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;un&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;md5&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;pass&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$login&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$gmto&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;NULL&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// check data from cookie&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_COOKIE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;un&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;md5&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_COOKIE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;pw&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$login&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;md5&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_COOKIE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;login&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$gmto&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;md5&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_COOKIE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;gmto&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$utds&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;md5&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_COOKIE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;utds&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_connect&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$host&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$login2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) or die(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;cannot access mysql\&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fyd&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_select_db(&#039;findyourdesire&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) or die(\&quot;cannot connect to db\&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$lookup&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_query(\&quot;SELECT * FROM users WHERE username=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&lt;br /&gt;if (mysql_num_rows(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$lookup&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)==0) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // there was no user by that name&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bgnpg(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); nav(); login(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, TRUE, 1); clspg();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// get all the info associated with the user&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_fetch_array(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$lookup&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;!=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;password&#039;]) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // the submitted password is wrong&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bgnpg(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); nav(); login(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, TRUE, 2); clspg();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sa&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;site_access&#039;];&lt;br /&gt;if (!contains(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sa&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$regulars&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) &amp;amp;&amp;amp; !contains(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sa&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$desireds&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // the user is suspended&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bgnpg(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); nav(); login(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, TRUE, 3); clspg();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// user login via form?&amp;nbsp; or via cookie?&lt;br /&gt;if (isset(_&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;un&#039;])) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // set login, cookie duration, uid&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$login&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = TRUE;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$duration&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp;&amp;nbsp; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;login_duration&#039;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;uid&#039;]; &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // set the gmt offset &amp;amp; time display&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$gmto&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp;&amp;nbsp; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;gmt_offset&#039;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rtds&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp;&amp;nbsp; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$info&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;tds&#039;];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$utds&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp;&amp;nbsp; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$tds&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rtds&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // get the new ip&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$now&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; = gmdate(\&quot;Y-m-d H:i:s\&quot;, time());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$currip&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;REMOTE_ADDR&#039;];&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // update login date and ip&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$update&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_query(\&quot;UPDATE users SET last_login_ip=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$currip&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;, last_login_date=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$now&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039; WHERE uid=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;\&quot;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$aff&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; = mysql_affected_rows(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$errno&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp; = mysql_errno(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$error&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp; = mysql_error(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$db&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // debugging stuff&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ll&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$durr&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$duration&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uts&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; = time();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$exp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; = gmdate(\&quot;Y-m-d H:i:s\&quot;, (time()+(60*&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$durr&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$duration&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)));&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // set expiration by formula time()+seconds*minutes*hrs*days*yrs&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = time()+(60*&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$durr&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$duration&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setcookie(&#039;un&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // set username&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setcookie(&#039;pw&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$pass&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&amp;nbsp;&amp;nbsp;&amp;nbsp; // set password&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setcookie(&#039;login&#039;, 1, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // set login&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setcookie(&#039;gmto&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$gmto&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&amp;nbsp; // set the gmt offset&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; setcookie(&#039;utds&#039;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$utds&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&amp;nbsp; // set the time display style&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // debugging stuff&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$linfo&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;&amp;lt;p&amp;gt;debug:&amp;lt;br /&amp;gt;un:&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br /&amp;gt;gmto: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$gmto&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br /&amp;gt;tds: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$rtds&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;--&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$utds&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br /&amp;gt;login length: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$ll&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, exprire: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; / &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$exp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, now: &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uts&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; / &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$now&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;update: UPDATE users SET last_login_ip=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$currip&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;, last_login_date=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$now&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039; WHERE uid=&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$uid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$aff&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$errno&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br /&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$error&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// user is legit, welcome!&lt;br /&gt;bgnpg(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); nav2(); success(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$linfo&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;); clspg();&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;Also, I would advise against alerting the user as to why an attempted login failed.&lt;br /&gt;
By telling the user that the username doesn&#039;t exist, or the password wasn&#039;t correct, you&#039;re simplifying it for a hacker.&lt;/p&gt;
 </description>
     <pubDate>Fri, 05 Sep 2003 04:43:11 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1137284 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/staying-logged-cookie-expiringresetting-issue#comment-1137273</link>
    <description> &lt;p&gt;i realized that&#039;s causing some comfusion so i chaged the login script so that it doesn&#039;t use that, and added a function specifically for the login when it&#039;s successful to do the navigation bar (it would be a pain in the *** to add something to nav() and go back through about 30 pages and add it to them all.&lt;/p&gt;
&lt;p&gt;i hope the change makes things more clear. it&#039;s been reflected in the login.issues page&lt;/p&gt;
 </description>
     <pubDate>Thu, 04 Sep 2003 20:17:10 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1137273 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/staying-logged-cookie-expiringresetting-issue#comment-1137272</link>
    <description> &lt;p&gt;I still think that this is the problem:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if(isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;un&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;])){&lt;br /&gt;&amp;nbsp; if(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$login&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;bgnpg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;nav&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;success&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$linfo&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;clspg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;&amp;nbsp; }else{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;bgnpg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;nav&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;login&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$error&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;clspg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}else{&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;bgnpg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;nav&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;login&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;clspg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;You&#039;re not checking cookies anywhere.  Again, I haven&#039;t fully examined your code, but perhaps somethign along the lines of:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if(isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;un&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;])){&lt;br /&gt;&amp;nbsp; if(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$login&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;bgnpg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;nav&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;success&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$linfo&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;clspg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;&amp;nbsp; }else{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;bgnpg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;nav&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;login&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$error&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;clspg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}else{&lt;br /&gt;&amp;nbsp; if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_COOKIE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;un&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]!=&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;bgnpg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;nav&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;success&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$un&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$linfo&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;clspg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;&amp;nbsp; }else{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;bgnpg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$title&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;nav&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;login&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;FALSE&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;); &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;clspg&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;();&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Thu, 04 Sep 2003 19:07:28 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1137272 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/staying-logged-cookie-expiringresetting-issue#comment-1137271</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: &lt;em&gt;Originally posted by Suzanne &lt;/em&gt;&lt;br /&gt;
&lt;strong&gt;Back down m3rajk, if you want help, give people all the pieces.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Does your $durr array give the minutes, hours, days, then?&lt;/p&gt;
&lt;p&gt;Regardless, the user/pass should be set in the cookie or a session. It should not be in the _POST only or it will be lost, resulting in what you&#039;re seeing -- they keep getting &quot;logged out&quot;. In reality, unless you&#039;re hiding more, they were only briefly allowed to see the logged in condition, they were not actually logged in. &lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;sorry. i just know it&#039;s not how i&#039;m setting them initially because the join page has one set on the frist step, that was working. i didn&#039;t do anything again until the 4th step. but ast night there was an issue with that eone, even through several people including myself got through it in the past, even after i found this one.. the most recent being the day before.&lt;/p&gt;
&lt;p&gt;the dur array is in minutes. &lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;# login durations&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$durr&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=array(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;15&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;30&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;), (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;24&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;), (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;60&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;24&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;365&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;));&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;the last option being for people that don&#039;t want to have to log back in via the page. options are 2 min, 5 min, 15 min, 30 min, 1 hr, 2 hrs, 1 day, and 5 yrs.&lt;/p&gt;
&lt;p&gt;the login script checks to see if $_POST[&#039;un&#039;] is set because if it isn&#039;t, you&#039;re at the page the first time, if it is, you&#039;re trying to login, so it goes through that and figures out what, if any, error you should have....username not found, password doesn&#039;t match, or you&#039;ve logged in. (i realized you can&#039;t use cookies the time you log them in, so i&#039;m going to modify the nav bar and where the pagess are called so it can set the login to truefor the user, but i wanna get the issue with the coookies only lasting one pageload worked out first)&lt;/p&gt;
&lt;p&gt;i have one cookie that&#039;s working, which is why these cookies not working is extremely frustrating. especially when someone said i&#039;m setting it for half a day when i&#039;m pretty sure i said i have an array of choices in minutes that i multiply by 60 seconds when i add it tot time, which is exactly what i was then told to do. that made his post really frustrating because it didn&#039;t address anything that i didn&#039;tknow. maybe if i mentioned that i have the other cookie that works correctly the post would have been better..&lt;/p&gt;
&lt;p&gt;i&#039;ve been trying to fix this since last friday.&lt;/p&gt;
&lt;p&gt;i i ONLY use cookies for things to carry between pages. i understand what stateless means and that get and post only work for the next page loaded.&lt;/p&gt;
 </description>
     <pubDate>Thu, 04 Sep 2003 18:40:35 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1137271 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/staying-logged-cookie-expiringresetting-issue#comment-1137176</link>
    <description> &lt;p&gt;$_POST cannot be carried between pages.  Only $_SESSION and $_COOKIE can store data between page hits.  $_SESSION will only retain the value as long as the browser (or a child of the session-initiating browser) stays open, $_COOKIE will only retain the value until the expiration time is reached.&lt;/p&gt;
 </description>
     <pubDate>Wed, 03 Sep 2003 04:49:21 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1137176 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/staying-logged-cookie-expiringresetting-issue#comment-1137165</link>
    <description> &lt;p&gt;Back down m3rajk, if you want help, give people all the pieces.&lt;/p&gt;
&lt;p&gt;Does your $durr array give the minutes, hours, days, then?&lt;/p&gt;
&lt;p&gt;Regardless, the user/pass should be set in the cookie or a session. It should not be in the _POST only or it will be lost, resulting in what you&#039;re seeing -- they keep getting &quot;logged out&quot;. In reality, unless you&#039;re hiding more, they were only briefly allowed to see the logged in condition, they were not actually logged in.&lt;/p&gt;
 </description>
     <pubDate>Tue, 02 Sep 2003 21:13:03 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1137165 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
