I found required solution here, But the solution uses reflection and sets the sessionId. In future if Asp.net internals get changed, this solution may break.

I tried,

SessionIDManager manager = new SessionIDManager();
string newSessionId = manager.CreateSessionID(context);
bool isAdd = false, isRedir = false;

// Save a new session ID
manager.SaveSessionID(context, newSessionId, out isRedir, out isAdd);

None of the method are setting HttpContext.Current.Session.SessionID

0

There are 0 best solutions below