Written by

Question Uri Shmueli · Nov 10, 2016

Client name in %CGIEVAR("HTTP_COOKIE")

Hi all,

We've found that in most cases when we open a new CSP session the CGI varaiable %CGIEVAR("HTTP_COOKIE") contains the client name.

It looks like that : "state=SYSADM%3A0; Username=Urish; CSPWSERVERID=Cache for Windows (x86-64) 2013.1.1 (Build 501_1_13062) Sun Aug 11..."
In some other cases this CGI only contains  $zv - like "CSPWSERVERID=Cache for Windows (x86-64) 2013.1.1 (Build 501_1_13062) Sun Aug 11 2013 23:20:33 EDT"

We are searching for a way to get the username (we need to stop using activex controls, like WScript.Network-->dNET.UserName), and this might be a good solution, if we can get answers to:

1. Why %CGIEVAR("HTTP_COOKIE")  contains the client name ?

2. In what cases it will NOT contain the client name ?

Comments

Tomas Vaverka · Nov 10, 2016

It is not client name but Caché Username ($USERNAME). The 'Username' cookie is set by Management Portal, it's just to remember last user who was logged on. You cannot depend on this cookie in your application.

To get the client name, you should check some other CGIENV variables, like REMOTE_ADDR resp. REMOTE_USER. But it doesn't always exist.

Please, let us know what information you are looking for. Do you need to know name of the remote user connecting to the application?

0
Uri Shmueli · Nov 14, 2016

Thanks Tomas.

Yes we need to know the name of the remote user.

We use it for many purposes in our applications.

As I mentioned before - we used Activex to get dNET.Username but since we are moving to HTML5 we cannot use it anymore.

Uri

0