Creating a secure login using sessions and cookies in PHP

前端 未结 5 1337
暖寄归人
暖寄归人 2020-12-05 01:08

I am making a login script that I would like to be as secure as possible. Problem is, security seems to be a never ending battle. So essentially, I am looking for suggestion

5条回答
  •  醉酒成梦
    2020-12-05 01:42

    SESSION more secure than cookie and my advise is to create a unique id for the current login attempted like :

    $id = uniqid();
    $_SESSION['username'.$id] = "something ...";
    

提交回复
热议问题