Does $_SESSION['username'] need to be escaped before getting into an SQL query?

后端 未结 5 1346
猫巷女王i
猫巷女王i 2021-01-25 01:47

I am wondering if anything from the $_SESSION array needs to be escaped before I use it in a SQL query.

Note that I don\'t use cookies in my application, since I\'ve hea

5条回答
  •  無奈伤痛
    2021-01-25 02:00

    Session variables are just like any other variables. The data in there have to come from somewhere. if you directly store a posted variables there, then it is basically like using the posted variable.

    The only diff is that a session variable persist across different access, and that is about it.

提交回复
热议问题