Note that there are some explanatory texts on larger screens.

plurals
  1. POsession variable becoming null after some time
    text
    copied!<p>I have developed a web application which will perform slideshow of some images.I have jquery ajax web method call for this application</p> <p>The images are rolling perfectly...But after some time it is stopping...I found out from logs that my session variable(here Session["Username"]) is becomming null.My code is</p> <pre><code> [WebMethod] [ScriptMethod] public static string GetNextImage() { try { if (HttpContext.Current.Session["Username"] != null) { string username = HttpContext.Current.Session["Username"].ToString(); RollingScreenBAL bal = new RollingScreenBAL(); DetailsForSlideShow[] details = bal.GetDetailsForSlideShow(username); int count = details.Length; int i; for (i = 0; i &lt; count; i++) { if (HttpContext.Current.Session["Count"] == null) { HttpContext.Current.Session["GraphUrl"] = details[0].GraphUrl; HttpContext.Current.Session["Count"] = i + 1; break; } else { if (Convert.ToInt32(HttpContext.Current.Session["Count"]) == i) { HttpContext.Current.Session["GraphUrl"] = details[i].GraphUrl; if (i == (count - 1)) { HttpContext.Current.Session["Count"] = null; } else { HttpContext.Current.Session["Count"] = i + 1; } break; } } } } return HttpContext.Current.Session["GraphUrl"].ToString(); } catch (Exception ex) { ConfigurationManager configMgr = new ConfigurationManager(); string traceFilePath = configMgr.GetTraceFilePath(); StreamWriter traceFile = new StreamWriter(traceFilePath, true); traceFile.WriteLine(ex.Message + "\n" + ex.StackTrace + "Current User is " + **HttpContext.Current.Session["Username"])**; traceFile.Close(); return ex.Message; } } </code></pre> <p>HttpContext.Current.Session["Username"]) session value is becoming null..Can anyone please help me why it is going null? Thanks in advance...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload