<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1021150" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1021150</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sessions#comment-1130533</link>
    <description> &lt;p&gt;That&#039;s great.  Glad it worked out.&lt;/p&gt;
 </description>
     <pubDate>Fri, 02 May 2003 21:53:47 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1130533 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sessions#comment-1130529</link>
    <description> &lt;p&gt;Yes, that is exactly how it works. Once the session key was recognized on sessions2.php, it was smooth sailing.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;TonyMontana&lt;/p&gt;
 </description>
     <pubDate>Fri, 02 May 2003 18:33:05 +0000</pubDate>
 <dc:creator>TonyMontana</dc:creator>
 <guid isPermaLink="false">comment 1130529 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sessions#comment-1130453</link>
    <description> &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;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;//sessions1.php&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;session_start&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;$sid &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;session_id&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;session_register&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;fla_key\&quot;);&lt;br /&gt;session_register(\&quot;sess_key\&quot;);&lt;br /&gt;session_register(\&quot;sess_timestamp\&quot;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = 1;&amp;nbsp;&amp;nbsp; // (in minutes)&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$time_stamp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mktime() + ( &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; * 60 );&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$enc_time&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = md5( &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$time_stamp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; );&lt;br /&gt;&lt;br /&gt;// set session vars&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_timestamp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$time_stamp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_key&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$enc_time&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_key&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&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;//sessions2.php&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;session_start&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;$sid &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;session_id&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;session_register&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;fla_key\&quot;);&lt;br /&gt;session_register(\&quot;sess_key\&quot;);&lt;br /&gt;session_register(\&quot;sess_timestamp\&quot;);&lt;br /&gt;&lt;br /&gt;if (!isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_key&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)) {exit;}&lt;br /&gt;&lt;br /&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_timestamp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; &amp;lt;= mktime() ) {exit;}&lt;br /&gt;&lt;br /&gt;if (!isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fla_key&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;) || &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$fla_key&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;!=&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_key&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; ) {exit;}&lt;br /&gt;&lt;br /&gt;// send sensitive data&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;Ok... I think this is the latest, right?  I&#039;m not very experienced with PHP &amp;amp; Flash applications.  I&#039;m guessing that the output of sessions1.php is being sent to Flash, and then Flash requests sessions2.php.  sessions2.php validates with the session vars, then sends the sensitive data.  Is this the plan?&lt;/p&gt;
&lt;p&gt;Let me know how this works out.  I&#039;ve never tried mixing sessions with Flash, and I&#039;m curious how it works out.&lt;/p&gt;
 </description>
     <pubDate>Thu, 01 May 2003 18:55:18 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1130453 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sessions#comment-1130364</link>
    <description> &lt;p&gt;Mark, that script works with v.4.0.6! First one I&#039;ve seen on the net that has. &lt;/p&gt;
&lt;p&gt;What kind of session checks would you do before echoing the data?&lt;/p&gt;
&lt;p&gt;Here&#039;s a couple of simple ones I had in mind:&lt;/p&gt;
&lt;p&gt;if(!isset($sess_key)){exit;}&lt;/p&gt;
&lt;p&gt;// key sent to Flash in sessions1.php&lt;br /&gt;
if( isset($fla_key) &amp;amp;&amp;amp; $fla_key != $sess_key ){exit;}&lt;/p&gt;
&lt;p&gt;if($sess_timestamp &amp;lt;= mktime() ) {exit;}&lt;/p&gt;
&lt;p&gt; Maybe you can embellish upon those, or add a few more options.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Tony&lt;/p&gt;
 </description>
     <pubDate>Wed, 30 Apr 2003 18:50:15 +0000</pubDate>
 <dc:creator>TonyMontana</dc:creator>
 <guid isPermaLink="false">comment 1130364 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sessions#comment-1130290</link>
    <description> &lt;p&gt;ok.. $_SESSION was added in 4.1.0 (&lt;a href=&quot;http://www.php.net/release_4_1_0.php&quot; class=&quot;bb-url&quot;&gt;release notes&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;try this then (not tested):&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;//sessions1.php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;session_start&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;br /&gt;&lt;br /&gt;echo \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;pre&amp;gt;\n\&quot;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &#039;1&#039;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$time_stamp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mktime() + ( &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; * 60 );&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$enc_time&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = md5( &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$time_stamp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; );&lt;br /&gt;&lt;br /&gt;// echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;sess_key&#039;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = session_id();&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$SID&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = SID;&lt;br /&gt;&lt;br /&gt;echo \&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br&amp;gt;\n\&quot;;&lt;br /&gt;&lt;br /&gt;// # set session vars&lt;br /&gt;session_register(\&quot;sess_timestamp\&quot;);&lt;br /&gt;session_register(\&quot;sess_key\&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_timestamp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$time_stamp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_key&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$enc_time&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;// _KEY is the var to pass with unique id...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// echo alone or with other data&lt;br /&gt;echo \&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_key&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br&amp;gt;\n\&quot;;&lt;br /&gt;&lt;br /&gt;echo \&quot;&amp;lt;br&amp;gt;\n\&quot;;&lt;br /&gt;echo \&quot;&amp;lt;a href=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;sessions2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;php&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;gt;sessions2.php&amp;lt;/a&amp;gt;\n\&quot;;&lt;br /&gt;&lt;br /&gt;echo \&quot;&amp;lt;/pre&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&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;//sessions2.php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;session_start&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;br /&gt;&lt;br /&gt;echo \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;pre&amp;gt;\n\&quot;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = session_id();&lt;br /&gt;session_register(\&quot;sess_key\&quot;);&lt;br /&gt;&lt;br /&gt;echo \&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br&amp;gt;\n\&quot;;&lt;br /&gt;echo \&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_key&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br&amp;gt;\n\&quot;;&lt;br /&gt;&lt;br /&gt;echo \&quot;&amp;lt;/pre&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
My server is running Apache 2 + PHP 4.3.0...  And wouldn&#039;t ya know it, PHP 4.3.2RC2 was just released today.&lt;/p&gt;
 </description>
     <pubDate>Wed, 30 Apr 2003 04:04:52 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1130290 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sessions#comment-1130260</link>
    <description> &lt;p&gt;Mark, on second check, there is only one line being echoed on &#039;sessions2.php&#039; for me, which is:&lt;/p&gt;
&lt;p&gt;echo &quot;$sid\n&quot;;&lt;/p&gt;
&lt;p&gt;&#039;$_SESSION[&#039;sess_key&#039;]&#039; is disappearing.&lt;/p&gt;
&lt;p&gt;  I noticed both lines are showing up on your demo. It must be because of the PHP version I am running (PHP v.4.0.6 which I am getting upgraded).&lt;/p&gt;
 </description>
     <pubDate>Tue, 29 Apr 2003 17:52:43 +0000</pubDate>
 <dc:creator>TonyMontana</dc:creator>
 <guid isPermaLink="false">comment 1130260 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sessions#comment-1130250</link>
    <description> &lt;p&gt;tested script:&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;//sessions1.php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;session_start&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;br /&gt;&lt;br /&gt;echo \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;pre&amp;gt;\n\&quot;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &#039;1&#039;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$time_stamp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mktime() + ( &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_expire&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; * 60 );&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$enc_time&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = md5( &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$time_stamp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; );&lt;br /&gt;&lt;br /&gt;// echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;sess_key&#039;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = session_id();&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$SID&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = SID;&lt;br /&gt;&lt;br /&gt;echo \&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br&amp;gt;\n\&quot;;&lt;br /&gt;&lt;br /&gt;// # set session vars&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;sess_timestamp&#039;] = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$time_stamp&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;sess_key&#039;] = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$enc_time&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;// _KEY is the var to pass with unique id...&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_KEY&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;sess_key&#039;];&lt;br /&gt;// echo alone or with other data&lt;br /&gt;echo \&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_KEY&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br&amp;gt;\n\&quot;;&lt;br /&gt;&lt;br /&gt;echo \&quot;&amp;lt;br&amp;gt;\n\&quot;;&lt;br /&gt;echo \&quot;&amp;lt;a href=\\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;sessions2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;php&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;gt;sessions2.php&amp;lt;/a&amp;gt;\n\&quot;;&lt;br /&gt;&lt;br /&gt;echo \&quot;&amp;lt;/pre&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&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;//sessions2.php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;session_start&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;br /&gt;&lt;br /&gt;echo \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;pre&amp;gt;\n\&quot;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = session_id();&lt;br /&gt;&lt;br /&gt;echo \&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&amp;lt;br&amp;gt;\n\&quot;;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;sess_key&#039;].\&quot;&amp;lt;br&amp;gt;\n\&quot;;&lt;br /&gt;&lt;br /&gt;echo \&quot;&amp;lt;/pre&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
demo: &lt;a href=&quot;http://host.maxalbert.com/testing_center/sessions1.php&quot; class=&quot;bb-url&quot;&gt;http://host.maxalbert.com/testing_center/sessions1.php&lt;/a&gt;&lt;br /&gt;
sources: &lt;a href=&quot;http://host.maxalbert.com/testing_center/phps_files/&quot; class=&quot;bb-url&quot;&gt;http://host.maxalbert.com/testing_center/phps_files/&lt;/a&gt;&lt;/p&gt;
 </description>
     <pubDate>Tue, 29 Apr 2003 16:46:13 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1130250 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sessions#comment-1130249</link>
    <description> &lt;p&gt;add this to sessionTest2.php:&lt;br /&gt;
$sid = session_id();&lt;/p&gt;
 </description>
     <pubDate>Tue, 29 Apr 2003 16:39:51 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1130249 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sessions#comment-1130188</link>
    <description> &lt;p&gt;As a simple test, with the first script:&lt;/p&gt;
&lt;p&gt;// sessionTest1.php&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;br /&gt;session_start&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;$sess_expire &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;1&#039;&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;$time_stamp&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;=&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mktime&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;() + ( &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sess_expire &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;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$enc_time &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;$time_stamp &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: #FF8000&quot;&gt;// echo $_SESSION[&#039;sess_key&#039;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;session_id&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;$SID &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;SID&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: #FF8000&quot;&gt;// # set session vars&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;sess_timestamp&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$time_stamp&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;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;sess_key&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;] = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$enc_time &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;. &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// _KEY is the var to pass with unique id...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_KEY &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SESSION&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;sess_key&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// echo alone or with other data&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;echo&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_KEY&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; &lt;/p&gt;
&lt;p&gt;A key is echoed. Now try to read session with second script:&lt;/p&gt;
&lt;p&gt;// sessionTest2.php&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;br /&gt;session_start&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(); &lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// returns nothing&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;
&lt;p&gt;hmmmmmmmmmm...&lt;/p&gt;
 </description>
     <pubDate>Mon, 28 Apr 2003 19:52:37 +0000</pubDate>
 <dc:creator>TonyMontana</dc:creator>
 <guid isPermaLink="false">comment 1130188 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-sessions#comment-1130187</link>
    <description> &lt;p&gt;here is an exurpt from another script of mine:&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;// we don&#039;t want messy URLs....&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;ini_set&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;session.use_trans_sid\&quot;, 1);&lt;br /&gt;&lt;br /&gt;// how long before session is considered garbage&lt;br /&gt;ini_set(&#039;session.gc_maxlifetime&#039;, _SESSION_IDLE_TIME * 60);&lt;br /&gt;&lt;br /&gt;// percentage to check for garbage&lt;br /&gt;ini_set(&#039;session.gc_probability&#039;, 1);&lt;br /&gt;&lt;br /&gt;// resume any old sessions&lt;br /&gt;// set the PHP session_name&lt;br /&gt;session_name(&#039;wahl_session&#039;);&lt;br /&gt;&lt;br /&gt;// start the PHP session&lt;br /&gt;session_start();&lt;br /&gt;&lt;br /&gt;// get the PHP session_id&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$sid&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = session_id();&lt;br /&gt;&lt;br /&gt;// SID is a PHP defined constant used for passing sessions in links&lt;br /&gt;// SID = session_name=session_id&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$SID&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = SID;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
I dont believe the session_name() is required.  But I do know that if you&#039;re gonna use it, it needs to be set before calling session_start().&lt;/p&gt;
&lt;p&gt;How are you going from one page to the other?&lt;/p&gt;
 </description>
     <pubDate>Mon, 28 Apr 2003 19:33:13 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1130187 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
