I am seeing an issue with Kentico where calling URLHelper.Redirect() is logging out the user. This is happening on a registration page. The new Kentico CMS_User object has already been created because if I don't call the Redirect method and just browse to another page, like the user profile page, I stay logged in.
Does anyone have any idea what might cause this method to log the user out?
FYI, I was able to fix this by implementing
in the line before I call the Redirect() method.
Could you please provide some more info:
Are you using a web farm or do you have load balancer in front of the website? If so you need to set up Redis Cache or SQL Server database session. Any postback or redirect can cause the "authenticated" user to lose their session. By default the URLHelper.Redirect() does NOT log a user out.
This is Kentico 12 portal engine. @Brendan thanks I'll check that out
Before implementing that, I'd suggest looking further into why your cookie is not persisiting. As I stated, the redirect DOES NOT cause a user to log out but a postback could cause issues with persisting the users session if you have a load balancer or a web farm set up. All your line of code is doing now is masking the underlying issue.
Please, sign in to be able to submit a new answer.