Post new topic    Reply to topic
Login to print this topic
Author Message
xion`silo
PostPosted: Wed Jun 04, 2008 3:39 pm Reply with quote

PRO Level 2
 
 


Joined: 02 Jun 2008
Posts: 15
Location: Austin, TX
Im writing a script for a different kind of login/ecommerce site but i have too many sessions going on at one time. That probably will cause the script to run slower. Heres the code:
Code:

// Login was successfull
         $row = mysql_fetch_array($result);
         //Save the user ID for use later
         $_SESSION['cust_id'] = $row['cust_id'];
         $_SESSION['logged_in'] = 1;
         $_SESSION['cust_fname'] = $row['cust_fname'];
         $_SESSION['cust_lname'] = $row['cust_lname'];
         //Save the username for use later
         $_SESSION['username'] = $u;
         if ($row['cust_type'] == "1")
         {
            $_SESSION['1'] = $row['cust_type'];
         }
         if ($row['cust_type'] == "2")
         {
            $_SESSION['2'] = $row['cust_type'];
         }
         if ($row['cust_type'] == "3")
         {
            $_SESSION['3'] = $row['cust_type'];
         }


please if someone knows any way to fix this to make the sessions smaller or compact them into an array or idk. smile thanks
 
Back to top
Back to top
Index >> Webmaster Domain & Code Room >> better way to do sessions in php?

Page 1 of 1

Post new topic   Reply to topic


Tired of the Ads? Registered users have 80% less adverts.