470,810 Members | 1,147 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,810 developers. It's quick & easy.

Application control is redirecting to the login page on every serverrequest

Hi All,
I am facing this very weird issue, for every server request my control
is redirecting to the login page and again coming back to the actual
page from where the request was initiated when I set my custom
Remember be cookie on the login page. Following are the details:
1. Authentication mode is ‘Forms’
2. This issue is reproducible only in deployed applications, I found
this using my trace and remote debugging
3. This issue occurs only when user selects the ‘Remember Me’ option
at the time of login, then I set the custom cookie for storing the
user info. (inbuilt Remember Me of login control is not used as I need
the fixed expiration and not the sliding one)
4. It is also observed that issue occurs only when I create a msi and
deploy it, if I just take the code and publish it on server the
application works fine and there are no unnecessary redirections to
5. Application is Ajax enabled
//Following is the code used for setting the cookie:
if (Request.Cookies.Get("UserCookie") != null)
HttpCookie decodedCookie =
Utilities.HttpSecureCookie.Decode(Request.Cookies. Get("TyreLinkCookie"));
if (decodedCookie.Values["LanguageCodeForMegaFleet"] != null &&
decodedCookie.Values["UICulture"] != null &&
decodedCookie.Values["Culture"] != null &&
decodedCookie.Values["ClientOffsetTime"] != null)
currentSessionInfo.LanguageCodeForMegaFleet =
currentSessionInfo.SessionUICulture =
currentSessionInfo.SessionCulture =
currentSessionInfo.LanguageForTyreDetails =
offset =

//Following the is the code that reads the cookie at the time of load
of login page:
if (Request.Cookies.Get("UserCookie") != null)
HttpCookie cookie = Request.Cookies.Get("UserCookie");
HttpCookie decodedCookie = Utilities.HttpSecureCookie.Decode(cookie);
if (decodedCookie.Values["Username"] != null &&
decodedCookie.Values["Password"] != null)
if (ValidateUser(decodedCookie.Values["Username"].ToString(),
FormsAuthentication.SetAuthCookie(decodedCookie.Va lues["Username"].ToString(),
Response.Redirect(LoginControl.DestinationPageUrl) ;

While I am probably almost certain that the issue is with Forms
Authentication and Cookies, I am not able figure out what it could
be. Please help.

Jun 27 '08 #1
0 772

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Edward Mitchell | last post: by
2 posts views Thread by Gary Coutts | last post: by
reply views Thread by ThePurpleCat | last post: by
4 posts views Thread by damiensawyer | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.