Session variables not working.

Posted by Community Admin on 04-Aug-2018 20:24

Session variables not working.

All Replies

Posted by Community Admin on 19-Mar-2013 00:00

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.

Posted by Community Admin on 19-Mar-2013 00:00

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.

This thread is closed