Usefull C# code. How to find an IMISID of currently logged in user.

Hi All,

Recently I run into the issue of where(how) to find iMIS ID of currently logged in user in iMIS Public views.
After some research I finally come up with folowing code:

// VERY USEFULL ONE - Returns iMIS ID for currently Logged in USER
private string GetCurrentiMISID()
{
string _id = "";
if (Request.Cookies["UserID"] != null)
{
_id = Request.Cookies["UserID"].Value;
Secure _tool = new Secure();
_id = _tool.Decrypt(_id);
}

return _id;
}

Please let me know if is helpfull and I promise to post more :))))

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

It's helpful

Keep posting :)

Questions

What is the Secure Class? Is that a standard C# class or is it a custom developed class.

Also is this only for the Public Site, or can you get the currently logged in user to the iMIS desktop as well?