I want to store user's screen resolution in database when user login. How to detect and store it to database when user login?
Asked
Active
Viewed 1,849 times
1 Answers
8
Read it with JavaScript (browsers don't send screen resolution information by default, so it isn't available to Ruby or anything else server side unless you make it so), then generate a hidden input, set the name and value based on the data you've gathered, then add it to the form containing the username and password inputs.
Oh, and you might find the window size more useful than the screen resolution. Not everybody maximizes their windows.

Quentin
- 914,110
- 126
- 1,211
- 1,335
-
+1 for suggesting to measure window size instead of screen resolution. – Pieter888 May 24 '12 at 07:40