CSRF, also known as Cross-Site Request Forgery is a trick which is commonly targeted to web forms. This is often used by (spam)bots but also by individuals who might try to break into your application.
At these times your visitors have all kinds of different screen resolutions and also resize their browser window. Resolutions vary between 1280×1024, 1680×1050, 1920×1200, 2560×1440 and all make a huge difference. And then there’s the difference between people who have their browser window maximized, while others resize it so they can fit other windows on the screen as well. There’s a relatively easy way to make it fit the window properly.
In this short tutorial I will show you some ways to protect a (login) web form against the most common types of attacks, making it much safer.
I will use PHP as the server-side programming language, but any other language will provide similar features.