How to create “remember me checkbox” using Codeigniter session library?

后端 未结 7 1161
梦如初夏
梦如初夏 2020-12-12 18:30

in Codeigniter I am building an Authentication system for my web site and to achieve that I use session library

     session->set_userdata(\'username\')
<         


        
7条回答
  •  轮回少年
    2020-12-12 18:48

    You could use isset to check if the cookie has a value, and if the cookie is deleted, it will return negative. If it is negative, you can set the cookie again... of course, this will be like "renewing" the cookie, so if the user doesn't come by the expiration, they will be forgotten. (Set a very big time till the expiration!)

    For example:

    
    

提交回复
热议问题