1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Session variables not working.

Session variables not working.

2 posts, 0 answered
  1. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    19 Mar 2013
    Link to this post
    As my Sitefinity user control loads, it calls an .aspx file, through an image tag, that displays an image and sets a value as a session variable.

    I have stepped through this .aspx file, and the value is successful added to the session. However, once I get to the user control code, the session variable is null.

    Is Sitefinity messing around with the IIS sessions and/or session variable?

    What do I need to do, to get my session variables to work?

    Code that sets the session variable in the .aspx file:

    Session.Add("Captcha", strCaptchaText)



    Code that attempts to read the session variable:

    return txtCaptcha.Text.ToUpper() == Session["Captcha"].ToString().ToUpper() ? true : false;



    Note: Yes, I know there is a Sitefinity CAPTCHA control, but I am having a hard enough time with the basics of 5.4, I don't want to have to try to use something new just yet.
  2. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    19 Mar 2013 in reply to Lurch
    Link to this post
    I thought I I found the issue, I was using the Visual Studio internal web server, rather than my IIS server.

    However, I am still seeing this issue with IIS. Not sure why I am loosing session variables when I run/debug my instance of the web application.
2 posts, 0 answered