Results 1 to 4 of 4

Thread: FireFox problems ..

  1. #1

    Thread Starter
    Member chocoloco's Avatar
    Join Date
    Mar 2006
    Posts
    42

    FireFox problems ..

    I am using FireFox version 1.5.0.4.

    On page_load, I have a login control that validates user credentials and if successfull, creates two session variables as shown in the code below ..

    if (auth.AuthenticatedUser(this.txtUserName.Text,this.txtPassword.Text) == true)
    {
    //Set non persistent cookie
    Session["AuthorizedViewAll"] = auth.CheckSecurityDescriptor(this.txtUserName.Text);
    Session["PeriodStartDate"] = DateTime.Now.AddDays(Convert.ToDouble(ConfigurationSettings.AppSettings["PeriodStartDateInterval"])).ToShortDateString();
    Session["PeriodEndDate"] = DateTime.Now.ToShortDateString();

    DataSet ds = auth.UserInfo(this.txtUserName.Text);

    if (ds.Tables[0].Rows.Count > 0 )
    {
    Session["user_id"] = ds.Tables[0].Rows[0]["user_id"].ToString();
    Session["user_name"] = this.txtUserName.Text;
    Session["agent_id"] = "8" + this.txtUserName.Text;
    Session["LoggedInProducerFName"] = ds.Tables[0].Rows[0]["first_name"].ToString();
    Session["LoggedInProducerLName"] = ds.Tables[0].Rows[0]["last_name"].ToString();
    Session["LoggedInProducerName"] = ds.Tables[0].Rows[0]["last_name"].ToString() + ", " + ds.Tables[0].Rows[0]["first_name"].ToString();
    }

    FormsAuthentication.SetAuthCookie(this.txtUserName.Text,false);
    if (auth.ChangePasswordFlag(this.txtUserName.Text) == true)
    {
    Response.Redirect("~/pub/passwordChange.aspx");
    }
    //Check if this is a new login or a session time out login
    string returnUrl = Request.QueryString["ReturnUrl"];
    if (returnUrl==null)
    //If it is a new login, redirect to the home page
    Response.Redirect("~/pub/home.aspx");
    else
    //If it is a session time out login, redirect to the original page
    FormsAuthentication.RedirectFromLoginPage(this.txtUserName.Text, false);

    }

    Then I am trying to access

    Session["PeriodStartDate"] and
    Session["PeriodEndDate"]

    variables on another page (after login is completed) and it gives me "Object reference not set to an instance of an object." error. It works fine in IE, what the hell is wrong with FF???? Can someone help?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: FireFox problems ..

    Cookies disabled? Is the application expecting Windows authentication in addition to the basic authentication/forms authentication? (Check IIS)

  3. #3

    Thread Starter
    Member chocoloco's Avatar
    Join Date
    Mar 2006
    Posts
    42

    Re: FireFox problems ..

    Thanks Mate !!

    But it was kinda stupid on my behalf in the end.

    Application had two pages, login.aspx and loginNS.aspx. I had added session variables in login.aspx, i did not realize application uses loginNS.aspx in case the browser is anything other than IE. (NS,FF etc ..) We got this app from a client and did not know this is how it worked.

    I added session variables in loginNS.aspx and everything worked fine.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: FireFox problems ..

    Tsk, tsk, I expected worse than that from you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width