[HttpGet] public ActionResult AuthRedirect(string access_token) { // Get the full URL from the request var url = Request.Url.ToString();
// Extract the fragment identifier var fragment = url.Substring(url.IndexOf('#') + 1);
// Parse the fragment to extract the access_token parameter value var queryString = HttpUtility.ParseQueryString(fragment); var accessToken = queryString["access_token"];
var cookie = new HttpCookie("otsession", accessToken) { Path = "/", HttpOnly = true, };