How does CodeIgniter know a cookie holds valid session data?

前端 未结 5 533
一整个雨季
一整个雨季 2021-01-03 23:19

In CodeIgniter, session data are saved in a cookie by default. But there must be also a file on my server (named as the session ID) to verify that the data (in the cookie) i

5条回答
  •  甜味超标
    2021-01-04 00:03

    Just tested this today with Firebug..

    To follow up on Shanee's answer, in CodeIgniter's "application/config/config.php" file, if one sets:

    $config['sess_use_database'] = TRUE;
    

    then only the default CI session data: session_id, IP_address.., is stored as a browser cookie.

    Any additional custom data provided by the set_userdata() function, such as usernames and passwords, are no longer part of the cookie but are instead stored in your database.

提交回复
热议问题