1. take a ScriptManager
2. set it property EnablePageMethods as true
4. write a public static method and mark it attribute as [WebMethod]
5. call above static method from javascript.
[System.Web.Services.WebMethod]
public static void ChangeSession(string value)
{
HttpContext.Current.Session["yourSessionKey"] = value;
}
in javascript
<input type="button" value="change session" onclick="ChangeSession('yourNewSessionValue');" />