Just in case someone needs session for Windows forms/WPF
It is recommended to use NuGet. F.ex through the VS Package Manager Console Install-Package iQuantile.DotLib.SessionManager
or using the VS "Manage NuGet Packages..." extension.
Session is a static class. add reference.
using static SessionManager.SharpSession;
SessionStart();
Session["A"] = 5;
int y = (int)Session["A"];
In stead of type casting use GET("key"). this will work like (T)Session["key"]
Session["A"] = 5;
int x = Get<int>("A");
In stead of type casting use SET("Key",value).this will store the data on Session[key]
Set("A", 10);
int y = (int)Session["A"];
SessionDestroy(); //destroys the session
SessionUnset(); //re initialize session
SessionReset(); //Sets all keys to null
RegenerateId(); // Creates new ID and appends to sessionID
int x = CreateId(); //Returns a new SessionID
public static int SessionId { get; set; } //Holds the session ID
public static string SessionName { get; set; } //Holds the session name