I'm seeing something a little weird with my application.
I have users accessing the site via an email invite. After logging in they are asked to change their password. When changing their password the update statement changes their password and toggles a flag column to say that the person is no longer an a first
time registrant. From there they are redirected to a form that has them complete/update their personal information. After updating their personal information they are taken to the confirmation page and they select their status. After choosing their status
they are taken to a description page. However, for a handful of these users they are redirected back to the update personal information page and get stuck in an endless loop unless they logout, close the browser, open a new browser and login again - then
they do not experience this loop and the sequence is normal.
On the description page I check to see what the status of their registration is: if it is pending, send them to complete/update their profile; if their status is confirmed then they can view the page. So I've now isolated my issue at that line of code.
int intStatus = DAL.GetRegistrationStatus(Request.QueryString["eventId"], intUserId);
if (intStatus == (int)RegistrationStatus.Pending)
Response.Redirect(string.Format("UpdateAttendeeInfo.aspx?eventId={0}", Request.QueryString["eventId"]));
What I'm wondering is why for some users the table that holds the registration status is not updating the user to their confirmed status. I am also storing their user id in a session variable - the variable is populated during successful login. I know storing values in the session object can be a bit hairy but does anyone know what could cause a hiccup on some computers but not all? Below is the code that calls the method to update registration status.
It's extremely hard to say anything definitive in such a broad issue scope. I'll try to give some suggestions for avenues of investigation (and some that I don't think are relevant).
If RegistrationStatus.Pending has the int-value of say 0, or -1, or a similar possible also default value, some other problem such as a try-catch-all hiding some other problem might cause your GetRegistrationStatus to return the wrong result, which is subsequently
interpreted as Pending. You should try to avoid using 0 as an actual value in enums for that reason.
If you have recycling enabled on the application pool, you may get involuntary recycling, causing the session to be reset. The defaults are unfortunately recycling after 1740 minutes and 20 minutes of idle. I suggest turning both off. The symptoms are not
quite right though, since that would probably cause a single redirect - unless they then bypass the code were Session["AttendeeId"] actually is set.
Include some logging! The easy way is to use System.Diagnostics.Debug.WriteLine, you can watch the output from Visual Studio or use sysinternals DebugView. Better is to add some real logging using System.Diagnostics.Trace and freinds - or why not go all
the way and add some HealthMonitoring! Specifically, you should break appart the one-liners and log the actual values received.
I don't think that it's a problem with cookies as such, since it appears to work out if you restart the browser. If cookies are disabled in the client it won't work at all, ever.
Thinking some more on it, I really think recycling might be the issue. You can check in the event log if recycling has occurred at about the same time where the users have experienced their problems.
Svante
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com [Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
Marked as answer by psuphish05 on Sep 26, 2008 01:46 PM
RegistrationStatus.Pending is a value of 1. However, .Accepted is a value of 0. Unfortunately, the app is not making it that far to set the value to 0. I will have to check with a couple of the users we have been working with to see if they let their
session idle out.
I didn't even think of app pool recycling - which could very well be the case. I am using GoDaddy as my hosting provider.
Definitely, I need to throttle up some of my logging. The only thing the system does right now is send me exceptions in my email. Which I thought I'd see some kind of exception like Null Reference if the session variable was recycled out.
Thanks again for the replay and the insight!
- Jesse
Jesse Williams
Please mark 'Answered' if my post was able to assist you.
psuphish05
Participant
1381 Points
278 Posts
User Caught In Endless Redirection Loop
Sep 26, 2008 05:06 AM|LINK
Hello Everyone,
I'm seeing something a little weird with my application.
I have users accessing the site via an email invite. After logging in they are asked to change their password. When changing their password the update statement changes their password and toggles a flag column to say that the person is no longer an a first time registrant. From there they are redirected to a form that has them complete/update their personal information. After updating their personal information they are taken to the confirmation page and they select their status. After choosing their status they are taken to a description page. However, for a handful of these users they are redirected back to the update personal information page and get stuck in an endless loop unless they logout, close the browser, open a new browser and login again - then they do not experience this loop and the sequence is normal.
On the description page I check to see what the status of their registration is: if it is pending, send them to complete/update their profile; if their status is confirmed then they can view the page. So I've now isolated my issue at that line of code.
int intStatus = DAL.GetRegistrationStatus(Request.QueryString["eventId"], intUserId); if (intStatus == (int)RegistrationStatus.Pending) Response.Redirect(string.Format("UpdateAttendeeInfo.aspx?eventId={0}", Request.QueryString["eventId"]));What I'm wondering is why for some users the table that holds the registration status is not updating the user to their confirmed status. I am also storing their user id in a session variable - the variable is populated during successful login. I know storing values in the session object can be a bit hairy but does anyone know what could cause a hiccup on some computers but not all? Below is the code that calls the method to update registration status.
Kind of at a loss as to what could cause this and to see if anyone has some insight. Thanks in advance!
- Jesse
Please mark 'Answered' if my post was able to assist you.
Svante
All-Star
18347 Points
2300 Posts
Re: User Caught In Endless Redirection Loop
Sep 26, 2008 08:05 AM|LINK
It's extremely hard to say anything definitive in such a broad issue scope. I'll try to give some suggestions for avenues of investigation (and some that I don't think are relevant).
I don't think that it's a problem with cookies as such, since it appears to work out if you restart the browser. If cookies are disabled in the client it won't work at all, ever.
Thinking some more on it, I really think recycling might be the issue. You can check in the event log if recycling has occurred at about the same time where the users have experienced their problems.
AxCrypt - Free Open Source File Encryption & Online Password Manager - http://www.axantum.com
[Disclaimer: Code snippets usually uncompiled, beware typos.]
______
Don't forget to click "Mark as Answer" on the post(s) that helped you.
psuphish05
Participant
1381 Points
278 Posts
Re: User Caught In Endless Redirection Loop
Sep 26, 2008 01:45 PM|LINK
Thanks for the reply!
RegistrationStatus.Pending is a value of 1. However, .Accepted is a value of 0. Unfortunately, the app is not making it that far to set the value to 0. I will have to check with a couple of the users we have been working with to see if they let their session idle out.
I didn't even think of app pool recycling - which could very well be the case. I am using GoDaddy as my hosting provider.
Definitely, I need to throttle up some of my logging. The only thing the system does right now is send me exceptions in my email. Which I thought I'd see some kind of exception like Null Reference if the session variable was recycled out.
Thanks again for the replay and the insight!
- Jesse
Please mark 'Answered' if my post was able to assist you.