Hello
I've some aspx pages located in the worksite web structure.
In these pages, the SessionContext object is used for 2 things :
- get the Session (IManSession) of the user
- get the WebDatabase name by SessionContext.Current.WebDatabase
now the problem I have is that I need to call these page from outside worksite web (I mean without login into worksite web through the login page).
This works fine using TrustedLogin2 and the following piece of code I found on the forum :
IManSession oSession;
oSession = SessionContext.Current.Session;
if (oSession == null)
{
IManDMS oDMS = new iManage.WorkSite.ManDMS();
IManSession oS = oDMS.Sessions.Add("SRVFILESITE");
IntPtr UToken = ((HttpWorkerRequest)((IServiceProvider)Context).GetService(typeof(HttpWorkerRequest))).GetUserToken();
int UT = UToken.ToInt32();
oS.TrustedLogin2(UT);
oSession = oS;
}
But, SessionContext.Current.WebDatabase remains null.
This makes me think that the SessionContext is not initiated correctly, which wouldn't surprise me given the situation.
Can anyone tell me if there is a way to "inialize" by hand the SessionContext object once we're connected with TrustedLogin2 method ?
Thanks