Lost SessionState

E

erickephart

I have a login page (Login.aspx) that (after a certain number of failed
attempts) displays a captcha. In SignIn.ascx the image is displayed
via: '<img src="JpegImage.aspx">'.

Here is the JpegImage class:
public class JpegImage : System.Web.UI.Page {
private void Page_Load(object sender, System.EventArgs e) {
// Change the response headers to output a JPEG image.
this.Response.Clear();
this.Response.ContentType = "image/jpeg";

// Create a CAPTCHA image using the text stored in the Session
object.
CaptchaImage ci = new
CaptchaImage(this.Session[SN.Captcha].ToString(), 120, 40, "Arial");

// Write the image to the response stream in JPEG format and
dispose the image object
ci.Image.Save(this.Response.OutputStream, ImageFormat.Jpeg);
ci.Dispose();
}
}

The problem seems to be that the Session is lost in JpegImage.
this.Session[SN.Captcha] is set in SignIn.ascx.cs. All this seemed to
work fine before switching to .NET 2.0 from 1.1.

Ideas?

Thanks,
Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top