<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1025109" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1025109</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/login-scripts-opinions-please#comment-1153413</link>
    <description> &lt;p&gt;oh ya: if you don&#039;t want people that aren&#039;t logged in to view the page at all use this:&lt;/p&gt;
&lt;p&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;header&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Location: yourloginpage.php\&quot;);&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;That will redirect them to the login page!&lt;/p&gt;
 </description>
     <pubDate>Fri, 18 Jun 2004 22:27:12 +0000</pubDate>
 <dc:creator>ShawnK</dc:creator>
 <guid isPermaLink="false">comment 1153413 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/login-scripts-opinions-please#comment-1153412</link>
    <description> &lt;p&gt;The best way to do this would be SSL. But, since you probaly don&#039;t have and cannot afford you should take a few precautions:&lt;/p&gt;
&lt;p&gt;1) &lt;strong&gt;ALWAYS&lt;/strong&gt; ENCRYPT PASSWORDS! The only password that should not be encrypted is the one that comes straight from the password text box that the user types.&lt;/p&gt;
&lt;p&gt;2) &lt;strong&gt;NEVER&lt;/strong&gt; store passwords inside of sessions!&lt;/p&gt;
&lt;p&gt;Besides that, the safest way to acomplish this is to use 2 tables for your script.&lt;/p&gt;
&lt;p&gt;the 1st would be yourdb.USERS:&lt;/p&gt;
&lt;p&gt;id | username | md5pass | first | last | email&lt;/p&gt;
&lt;p&gt;the 2nd would be yourdb.SESSION:&lt;/p&gt;
&lt;p&gt;username | login_time | sessid&lt;/p&gt;
&lt;p&gt;Now what you do is when a user logs in you create a random alphanumeric string and store it in sessid. Then store it in the second table along with the user that logged in and the time they logged in at.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;NOTE&lt;/strong&gt;: you repeat the above EVERYTIME they log in&lt;/p&gt;
&lt;p&gt;Then, store in your $_SESSION - the username and session id. You can also implode all the other data like email,first, and last in one string called profile.&lt;/p&gt;
&lt;p&gt;And in your header file check to make sure that username is set in the session and if it is test to make sure that login_time is before the current time, then check the sessionid. If all return true. Then they&#039;re good if not they shouldn&#039;t be allowed to view the page.&lt;/p&gt;
&lt;p&gt;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-&lt;br /&gt;
if you have a site that all people can view and you have components or modules or blocks that only logged in people can see, then instead of blocking the user from viewing the page in your header file just make a variable $loggedin and make is &quot;true&quot; and then for all your compnents test to see if logged in is true and if so show the component and ELSE don&#039;t show.&lt;/p&gt;
&lt;p&gt;I hope I helped you and I didn&#039;t confuse you.&lt;/p&gt;
 </description>
     <pubDate>Fri, 18 Jun 2004 22:25:53 +0000</pubDate>
 <dc:creator>ShawnK</dc:creator>
 <guid isPermaLink="false">comment 1153412 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/login-scripts-opinions-please#comment-1152909</link>
    <description> &lt;p&gt;It sounds like you&#039;re on your way. I believe the most secure access involves the session id encrypted in a cookie, and saved to a database. Then each page would read the cookie, check the database, and proceed accordingly (i.e. sorry, session timed out, sorry, you&#039;re not logged in, sorry, you&#039;re a evil script kiddie, shoo...)&lt;/p&gt;
 </description>
     <pubDate>Fri, 11 Jun 2004 02:48:03 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1152909 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
