I apologize for going with the 'it depends answer' but I'm not quite sure how you're using the ServiceStack Session in your current ASP.NET website and what 'pieces' of the SS Session you need. In my mind the SS Session is just a blob of data stored in a cache with a unique id for a user's (browser or client) requests/responses.
If your request for the Session data goes through the ServiceStack Pipeline then I'm pretty confident that you would need an AppHost instance to get this to work. The main reason being that SS needs to add a Request Filter and set the ss-id, ss-pid session cookies. These cookies are the 'Key' for storing/retrieving the Session data.
If your requests don't go through the ServiceStack Pipeline I would imagine you write your own code that uses an instance of ICacheClient and provide your own Key (perhaps using the ASP.NET SessionID? as a key) and an instance of AuthUserSession (or really any Class/Type). Below is an extremely naive example
Set up the Cache for the application to use
if you using something like Redis or other 'Stand Alone Server' cache you wouldn't make it a static variable on the application.
public class Global : HttpApplication
{
public static ICacheClient CacheClient;
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
BundleConfig.RegisterBundles(BundleTable.Bundles);
AuthConfig.RegisterOpenAuth();
RouteConfig.RegisterRoutes(RouteTable.Routes);
CacheClient = new MemoryCacheClient();
}
}
Access the Session from a code-behind page...
public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
var session = GetOrCreateSession();
}
private AuthUserSession GetOrCreateSession()
{
var session = Global.CacheClient.Get<AuthUserSession>(this.Session.SessionID);
if (session != null)
return session;
var authUserSession = new AuthUserSession();
Global.CacheClient.Set(this.Session.SessionID, authUserSession);
return authUserSession;
}
}