Works great in 4.1.6 - altough there are some very minor code changes -- it's very easy to figure it out... don't replace the entire block of code, just find the differences and use the 1 or 2 new lines.
Also, if you want to make the IP clickable, use this code instead of "IP:{$v.session_ip}"
Code:
IP: <a href="http://www.dnsstuff.com/tools/whois.ch?ip={$v.session_ip}&cache=off" target="_blank">{$v.session_ip}</a>