I have been reading that you HTML encode on the way back from the server to the client (I think?) and this will prevent many types of XSS attacks. However, I don\'t understa
HTML encoding turns The basic entities that are converted are: OWASP recommends encoding some additional characters: These encodings are how you textually represent characters that would otherwise be consumed as markup. If you wanted to write <div>, which means that any HTML markup will display on the page as text, rather than executed as HTML markup.
& to &< to <> to >" to "
' to '/ to /a you'd have to be careful that isn't treated like an HTML element. If you use a<b the text that will be displayed to the user will be a.