If Request.ServerVariables(‘LOGON_USER’) is returning an empty string, the problem is probably that your app allows anonymous users.
To change this:
- Open IIS manager
- right-click on your app name and choose properties
- Click on directory security tab
- Edit Authentication and Access Control
- Uncheck ’Enable anonymous’.