A Digital Age Deserves A Digital Leader

better way to do sessions in php?

better way to do sessions in php?

Postby xion`silo » Wed Jun 04, 2008 7:39 pm

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: Select all
// 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. :) thanks
PRO New Member
Posts: 9
Joined: Mon Jun 02, 2008 5:27 am
Location: Austin, TX

Return to HTML, CSS, and Scripts

Who is online

Users browsing this forum: No registered users and 10 guests

cron
cron