CodeIgniter sessions vs PHP sessions

后端 未结 5 865
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-08 00:31

I\'m relatively new to CodeIgniter and am making my first CI project in which there are user-accounts, etc. In the past, I have always used PHP\'s $_SESSION variable to this

5条回答
  •  盖世英雄少女心
    2020-12-08 00:58

    CI sessions has Storage size limitations

    As you are aware , CI sessions are cookies basically, whether you encrypt it or not. As far as security is concerned both have its on pros and cons.

    My concern was the size limit of CI sessions, It can hold only 4 kb data as its basically a cookie, while Native PHP session only stores reference id on cookie and all the session data is stored in server memory. This comes handy when you have a larger number of items need to be stored in a session.

    Say a shopping cart with more items, or a user music playlist with more than 50 tracks... etc.

    I hope this information helps someone some day.

    Cheers..!!

提交回复
热议问题