HI everybody,
I'm newbie to ruby. I want to get user's browser and OS information like
getting ip address using request.remote_ip. Is it possible.
Regards,
Veeraa.
···
--
Posted via http://www.ruby-forum.com/.
HI everybody,
I'm newbie to ruby. I want to get user's browser and OS information like
getting ip address using request.remote_ip. Is it possible.
Regards,
Veeraa.
--
Posted via http://www.ruby-forum.com/.
request.env["HTTP_USER_AGENT"]
Cheers,
Ganesh Gunasegaran.
On 26-Apr-07, at 3:49 AM, Veera Sundaravel wrote:
HI everybody,
I'm newbie to ruby. I want to get user's browser and OS information like
getting ip address using request.remote_ip. Is it possible.Regards,
Veeraa.--
Posted via http://www.ruby-forum.com/\.
Veera Sundaravel <veeraa2003@yahoo.co.in> writes:
HI everybody,
I'm newbie to ruby. I want to get user's browser and OS information like
getting ip address using request.remote_ip. Is it possible.Regards,
Veeraa.--
This information is part of the standard 'agent' information passed by browsers
as an environment variable (well accessible as an environment variable).
However, note that this information cannot be trusted (ie. its easy to fake and
some browsers actually provide ways of faking it).
How you actually access this information depends on whether your using a ruby
library or just reading the data from stdin from the server etc. Most libraries
provide an ENV hash or object that you can query.
Tim
--
tcross (at) rapttech dot com dot au
Hello,
As you have been tool, user agent information is not 100% reliable. Formerly, object detection was the way to go, but this is also broken since Gecko and others faked the implementation of some objects (for instance, document.all).
I think if someone fakes his user agent he is liable for the damage and carry on with the consequences (i. e. not being able to view the website properly). What you should never do is have your security depend on browser detection as that is always fake-able (even if the evil guy has to recompile Mozilla to say it is Internet Explorer SuperSecureEdition).
That being said, you can use my Javascript Browser Sniffer library to detect the browser: http://jsbrwsniff.sourceforge.net. You can use it on the client side (Javascript is executed on the client) or on the server side (Javascript is executed on the server, this only works with IIS/ASP as long as I now).
--
Pau Garcia i Quiles
http://www.elpauer.org
(Due to the amount of work, I usually need 10 days to answer)
Quoting Veera Sundaravel <veeraa2003@yahoo.co.in>:
HI everybody,
I'm newbie to ruby. I want to get user's browser and OS information like
getting ip address using request.remote_ip. Is it possible.Regards,
Veeraa.--
Posted via http://www.ruby-forum.com/\.
Ganesh Gunasegaran wrote:
request.env["HTTP_USER_AGENT"]
Cheers,
Ganesh Gunasegaran.
Hello sir!
Thank you very much for your prompt reply .
Regards,
Veeraa.
--
Posted via http://www.ruby-forum.com/\.
Hi,
I have one more doubt, here i want split the browser and OS information.
But using split function is not good one. Any other way.
Regards,
W3matter.
--
Posted via http://www.ruby-forum.com/.