I have a complex URL rewriting scheme which breaks the built in Forms Authentication ReturnUrl mechanism. I would like to grab the requested URL for later redirection away from my login.aspx. I can get this URL in Application_BeginRequest via HttpContext.Current.Request.AppRelativeCurrentExecutionFilePath. However, Session state is not available in Application_BeginRequest. How can I store this URL prior to ASP.NET redirecting me to login.aspx?
A:
Are client cookies an option? Without an available session state, I don't believe you have any server-side choices.
rwmnau
2010-04-23 17:55:57
Are cookies available from Application_BeginRequest? If so, that may work.
Mark Richman
2010-04-23 18:01:53
A:
You could use a static. However, you'll need something to key it to each user (e.g. user name, session identifier etc.). If you have to do it before the user is logged on, your only option is to stuff some sort of identifier into a cookie at which point you might just want to put the whole URL there.
Tom Cabanski
2010-04-23 18:02:15