I have a Controller with an Action inside that returns an image using using FileResult.
public ActionResult GetScreeny(long id)
{
if (Session["userID"] == null)
{
return Json("no session/cookie");
}
long userID =
Convert.ToInt64(
Session["userID"].ToString()
);
var dir = Library.AppVars.FILESERVER_IO_IMG_SAVE_PATH + userID.ToString();
var path = Path.Combine(dir, id + ".jpg");
return base.File(path, "image/jpeg");
}
This is how I request the image from a View:
<img id="imgtoshow" src="@Url.Content(Library.AppVars.siteURL + "/Files/GetScreeny/" + ViewBag.screenID)" alt="IMAGE" width="100%" />
Works on Desktop, but not on Mobile :[ How does sessions/cookies works on mobile?