php - Session is create and print in backend but not work in frontend -


i facing strange issue.

this problem happens on server. facing problem since last 5-6 days. working me until last 1 year.

when call login api, if user credential right create session.

here code:

if ($user){     if ($user['is_active'] == 1){         global $user_data;         $user_data = $user;         $response["error"] = false;         $_session['user_data'] = $user; // -- session create         print_r($_session); // session print.          $_session['is_login'] = 'no';         unset($_session['sessionx']);         $response['user_id'] = $user['user_id'];         $response['name'] = $user['name'];         $response['email'] = $user['email'];         $response['apikey'] = $user['api_key'];         $response['createdat'] = $user['created_date'];      } else {         $response['error'] = true;         $response['message'] = 'your account not active';     } } else { // user credentials wrong     $response['error'] = true;     $response['message'] = 'login failed. incorrect credentials'; } 

print_r of portion:

array (     [slim.flash] => array         (         )      [db_name] => arcade_intecigar     [user_data] => array         (             [user_id] => 1             [name] => zzz             [email] => zzz@abc.com             [api_key] => 3fef39209b3d03039cdb81d39566eb66             [lang_id] => en_us             [created_date] => 0000-00-00 00:00:00             [profile_pic] => ""             [img] => 1461269872mk-ok.png             [subscription_id] => 20             [is_active] => 1             [role_id] => 1             [delete_permission] => 1             [phone_number] => +14507013             [country_code] => 1             [total_usage_funds] => 0.0024999999441206             [total_available_funds] => 0.99750000238419             [paid] => trial             [currency] => usd         )  ) 

after login, redirecting app dashboard page , check if session available or not, strange session not available. , redirecting me login page.

look below code.

print_r($_session); // display blank if (!isset($_session['is_login']) && !isset($_session['is_lock'])) {     echo "<script>window.location='" . site_url . "login.php?redirect=" . $_server['request_uri'] . "';</script>"; } if (isset($_session['is_login']) && $_session['is_login'] == 'no' || $_session['is_login']== 'no') {     echo "<script>window.location='" . site_url . "login.php?redirect=" . $_server['request_uri'] . "';</script>"; }    

print_r of portion:

array ( [db_name] => arcade_intecigar )  

this problem happen because , on server there no inode memory avaiable more session create , per knowledge when session create in php time session file create , there no memory available that's why session not create .

use df -i command know inode memory on server.

check link more description: https://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html


Comments