Browser detection with anonymous user

I found this post to get a user's browser. The java code below does not work with an anonymous user. // BEGIN USER CODE String userAgent = getContext().getSession().getUserAgent(); return userAgent; // END USER CODE Does anyone know the java code to detect the browser of the anonumous user?
1 answers

If I remember correctly every user even an anonymous user has a session, did you try this out?

For a client side version see this post: