better way to do sessions in php?
1 post
• Page 1 of 1
better way to do sessions in php?
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
1 post
• Page 1 of 1
Return to HTML, CSS, and Scripts
Who is online
Users browsing this forum: No registered users and 10 guests