Javascript errors when changing compatibility mode from framework20sp2 to framework45

I am currently working on windows10/iis 10 machine.

I have a mvc solution that has compatibilityMode as Framework20sp2 in the machine key of the web.config. It works good for all other users who are using windows 7 machines. But, in my machine, it is not able to interact with other apps like other APIs as it throws authentication failed. The other app is unable to decrypt the cookie which is mostly related to form authentication error shown in the below link.

When I update the compatibility mode to Framework45. It works great and able to interact with other apps. But, now the issue is I get lot of javascript type and reference errors after this update (tried on firefox and chrome both). And, my login page is stuck as it does not render properly. This page is basically calling the other solution to render ui pages pointing jquery/v2.1.0 or boost/v1.3. This I guess is causing when you change compatibilityMode framework.

Once I change the compatibility mode to Framework20SP2, the pages renders properly and work great.

Is there a way to get the authentication issue resolved without changing the framework?

This got me my entire day. Not sure what is the issue. Any help would be greatly appreciated.