jaymc Posted October 14, 2006 Share Posted October 14, 2006 Right, Im just wondering how much I can rely on the security of SESSIONSOn my site, I use a lot of $_GET which is obviously an ideal opportunity for hackers to code injectHowever, When querying or updating mysql, I also use the following method[code]$user = $_SESSION['user'];$query = "SELECT * FROM `members` WHERE `username` = $user LIMIT 0,1"[/code]As you can see, it will only query the row that has a username equal to $user[b]Now, what are the chances of a hacker spoofing the session to make it equal what ever they want[/b] Quote Link to comment https://forums.phpfreaks.com/topic/23933-session-security/ Share on other sites More sharing options...
wildteen88 Posted October 14, 2006 Share Posted October 14, 2006 They wont.As the session is stored on the server and not on the client. The only way for a hacker to spoof a session is by getting a valid session id. In order to get the session id they need to be in the same room as you.Also about $_GET you should be validating the input not use raw GET data. Quote Link to comment https://forums.phpfreaks.com/topic/23933-session-security/#findComment-108783 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.