We are developing a web application that will use two factor authentication. We are likely to try and emulate something similar to that used by google, where to login you enter a username and password, and then receive a token in an SMS message to be entered as well.

We would like to allow users to remember a client machine if they would like to so that they can login for 30 days without requiring the second authentication method. What information will we have access to (through headers of the web page requests etc.) which we can use to uniquely identify this trusted client machine? 

Obviously a user can have more than one trusted client machine, and I completely expect that if they use two different browsers on the same trusted machine machine, each browser will have to be trusted independently.

Setting a cookie on the machine with some GUID which means this is trusted simply would not be good enough, as someone else could just copy the cookie, and create it on their own browser circumventing the two factor authentication.


Question: C# - Winforms Drawing on Bitmap
Answer: There are two solutions:


Do not draw on the bitmap; instead draw on an invisible bitmap that is on top of it.
Keep the original Bitmap and copy it just before drawing on it.


Once you have changed the pixels of a bitmap you cannot undo that unless you keep the original data.