472,958 Members | 2,276 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 1120

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

Similar topics

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...
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: 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...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.