gs.getSession().getProperty('user_agent_version') is null for IE when logging in via CMS

jamie_girouard
Giga Expert

I am trying to create a processor (similar to KnowledgeHomeLauncher) to take people to an alternate page if they are using an older browser version.

What I have found is that if you initially log in to ServiceNow (/navpage.do), you will get the correct browser version if you log in via IE11 if you later go to the CMS:

var browser_version = gs.getSession().getProperty('user_agent_version')+'';   // returns 11

However, if you log in directly to the CMS - bypassing navpage.do - that same call returns null.

Is there something needs to be added to the CMS login page to appropriately capture session information?

4 REPLIES 4

rgm276
Mega Guru

you can grab the browser info/version using this javascript call on any dynamic content block page (probably most useful in the header), that way if someone tried to change browsers, it will still work correctly as opposed to using the getProperty command above which does not always update correctly for multiple logins for the same users on difference browsers.


<script>


var ua = navigator.userAgent.toLowerCase();


( add your code to parse or evaluate the browser version here , and\or redirect as needed )


</script>



there is a good article on stackoverflow on parsing the returned value located here


http://stackoverflow.com/questions/2400935/browser-detection-in-javascript


Thanks, Robert.   I'm familiar with browser detection in Javascript and will consider that as a workaround for the time being.  



However, the fact that the user_agent_version isn't populated when logging in via CMS makes me wonder if there are other session variables that may not be populated correctly.


I was able to duplicate your null value issue listed above in my own dev instance, so I certainly can understand the concern, I would recommend opening a HI ticket with ServiceNow to have them address this.


Yes, I've gone ahead and done that and a problem record was created by SN.   Thanks!