It's possible to vary the Output Caching based on pretty much anything you want by using VaryByCustom, and providing a special function that will return the cache key string. For your case, try a directive like this:
<%@ OutputCache Duration="30" VaryByParam="myParam" VaryByCustom="mySessionVar" %>
Then in Global.asax, override the GetVaryByCustomString function for your application:
public override string GetVaryByCustomString(HttpContext context, string arg)
{
if(arg == "mySessionVar" && Session["mySessionVar"] != null)
{
return Session["mySessionVar"].ToString();
}
return base.GetVaryByCustomString(context, arg);
}