473,320 Members | 1,839 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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
login
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 =
decodedCookie.Values["LanguageCodeForMegaFleet"].ToString();
currentSessionInfo.SessionUICulture =
decodedCookie.Values["UICulture"].ToString();
currentSessionInfo.SessionCulture =
decodedCookie.Values["Culture"].ToString();
currentSessionInfo.LanguageForTyreDetails =
decodedCookie.Values["LanguageForTyreDetails"].ToString();
offset =
double.Parse(decodedCookie.Values["ClientOffsetTime"].ToString());
}
}

//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(),
decodedCookie.Values["Password"].ToString(),0.0))
{
FormsAuthentication.SetAuthCookie(decodedCookie.Va lues["Username"].ToString(),
false);
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.
Thanks,
Anup

Jun 27 '08 #1
0 810

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Edward Mitchell | last post by:
I have a problem that involves the error I receive when attempting to complete the asp.net web application example (Walkthrough: Creating a Web Application Using a Third-Party Business Object). ...
2
by: Hillary Hill | last post by:
I have a login page written in ASP. Once the user logs in to the system, by clicking the certain link they can navigate to the purchase module written in ASP.Net. In the purchase module the user...
2
by: Gary Coutts | last post by:
Hi, I am have problems redirecting from a login page. The login page is simple, with just 2 textboxes and one button. On the button click the routine below is called: I am using: Visual...
3
by: Katie | last post by:
Hi, I want to be able to send users links to pages in my website. But if they arent logged in I want them to first be redirected to the login page and after they login automatically be...
0
by: ThePurpleCat | last post by:
Hi, I've created a login page for my website that consists of only a Login Control. The page inherits a master page that has a loginname and loginstatus control. In web.config I have the...
1
by: cyberteck | last post by:
hi all, I have a page which i have two condition on this page. if it follows the first condition then it simply open the popup page and do something and it get closed. but in case of second...
0
by: Dhananjay | last post by:
Hi all, I have developed a Asp.net website application.It was working properly, but due to crash of system, I have downloaded Vs.net 2005 professional edition and sql server express. But now...
0
by: Anup Daware | last post by:
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...
4
by: damiensawyer | last post by:
Hi, I'm trying to do something in global.asax that I would have thought to be quite simple. Basically, any request at all should get sent to another page. I actually got the code below from a...
6
by: rpcchandu | last post by:
Hi Coders, I have to redirect from my server to the different server page by simulating the POST method submit from the Controller file, I tried using post_via_redirect, but could not succeed......
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.