Jump to content
MakeWebGames

Sanitizing user input using Javascript


Recommended Posts

Posted
I was wondering what are the best method(s) to secure user input using Javascript?

What if a user disables Javascript? Then they've basically disabled your security. Your security should really be handled by the server, not the users browser.

Posted
What if a user disables Javascript? Then they've basically disabled your security. Your security should really be handled by the server, not the users browser.

I was thinking this so if you have a JS game, you would always need server side checks right?

Posted
I was thinking this so if you have a JS game, you would always need server side checks right?

Depends on what style of game you have. If you've built a game that stores users data which being manipulated could allow users to cheat, then you'll need to conduct the checks before you save them on your server.

Posted
So is there no way to actually use JS to secure it?

You could do validation checks but as far as actually securing any inputs it could easily be disabled and bypassed.

Define what you mean by securing? What are you doing with the data?

Posted

You can certainly do checks however your users will be able to skip all the possible JS checks if they want. While if you run checks on the server, nobody will be able to avoid them, unless you leave some holes.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...