How to check for Persisted cookied when User goes to Login.aspx

Last post 05-16-2008 12:57 AM by satalaj. 11 replies.

Sort Posts:

  • How to check for Persisted cookied when User goes to Login.aspx

    05-13-2008, 9:49 AM

    On the Form_Load of the Login.aspx, I would like to check
    if the User has a "Persisted Cookie" (chkPersistCookie check box was checked).
    And if yes, I want to redirect them to Default.aspx.
    Is it possible to do this? thanks

    When a user logs in, they can check the chkPersistCookie box:
    FormsAuthentication
    .RedirectFromLoginPage(userID, chkPersistCookie.Checked);

  • Re: How to check for Persisted cookied when User goes to Login.aspx

    05-13-2008, 11:43 AM
    • Star
      8,483 point Star
    • satalaj
    • Member since 11-28-2007, 12:41 AM
    • Pune
    • Posts 1,677
    Something Like this

    protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)

    {

    if(Membership.ValidateUser(Login1.UserName,Login1.Password))

    {

    FormsAuthentication.SetAuthCookie(Login1.UserName,Login1.RememberMeSet);

    FormsAuthentication.RedirectFromLoginPage(Login1.UserName, Login1.RememberMeSet);

    }

    }

    Satalaj

  • Re: How to check for Persisted cookied when User goes to Login.aspx

    05-13-2008, 1:03 PM

    thanks Satalaj,
    I don't understand what the "Login1" is?

  • Re: How to check for Persisted cookied when User goes to Login.aspx

    05-14-2008, 12:51 AM
    • Star
      8,483 point Star
    • satalaj
    • Member since 11-28-2007, 12:41 AM
    • Pune
    • Posts 1,677

    Login1 is login control provided with ASP.net  2.0

    Satalaj

  • Re: How to check for Persisted cookied when User goes to Login.aspx

    05-14-2008, 9:18 AM

    I'm not using any of the Log In controls.
    Can I still use that code?

  • Re: How to check for Persisted cookied when User goes to Login.aspx

    05-14-2008, 10:48 AM
    • Member
      2 point Member
    • ikizcegroup
    • Member since 01-03-2008, 8:06 AM
    • Turkey
    • Posts 1

    Can you explain Login1?

    Don't forget to click "Mark as Answer" on the post that helped you.
    This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
  • Re: How to check for Persisted cookied when User goes to Login.aspx

    05-15-2008, 12:57 AM
    • Star
      8,483 point Star
    • satalaj
    • Member since 11-28-2007, 12:41 AM
    • Pune
    • Posts 1,677

    yes,
     What you need to do is Drag and drop two TextBoxes and one Check Box.
    e.g

    txtUserName
    txtPassword
    chkRememberMe

    replace the Login1.RememberMeSet with chkRememberMe.Checked
    and Login1.UserName with txtUserName.Text etc.

    Login1 is an object of Control Class Login.
    ASp.Net 2.0 provides Built in set of Login Controls

    Satalaj

  • Re: How to check for Persisted cookied when User goes to Login.aspx

    05-15-2008, 1:34 AM
    • Member
      6 point Member
    • xmatt
    • Member since 05-15-2008, 5:19 AM
    • Posts 14

    Hi

    Can I use the Login Control for form authorization.

     Since I use a webb hotel (discount asp) can I not set up (IIS role, members ....).

     /Xmatt

  • Re: How to check for Persisted cookied when User goes to Login.aspx

    05-15-2008, 2:08 AM
    • Star
      8,483 point Star
    • satalaj
    • Member since 11-28-2007, 12:41 AM
    • Pune
    • Posts 1,677

    hi xmatt and welcome to ASp.net.

    xmatt:

    Hi

    Can I use the Login Control for form authorization.

     Since I use a webb hotel (discount asp) can I not set up (IIS role, members ....).

     /Xmatt


    1. Login controls are used for Authentication.
    2. When user user sends the credentials to our site the Server side code checks wheather
        the user is valid or not If the user is valid  find his roles depending upon the user is in role  
        we do redirection of the user to appropriate page in web.
        once user starts hitting that page code sees wheather the user is Authorized or not to see 
        that page
    3. Here are thos videos http://asp.net/learn/videos/  related to Logn,Membership,Personalization , webparts and more.... .

    Satalaj
  • Re: How to check for Persisted cookied when User goes to Login.aspx

    05-15-2008, 9:33 AM
    • Member
      6 point Member
    • xmatt
    • Member since 05-15-2008, 5:19 AM
    • Posts 14

    Thanx for the Welcome!

    I have watched the video and as far as I understand according to the video can you use the asp.net control with some IIS config (some config for users, Memberships etc)

    Since I rent webspace at discount asp, can I not as far as I know do any config of IIS.

    So in order to make some kind of security have I conf the webconfig file with a user and a password (plan to connect this to database verey soon).

    Today have I a ordenery form with text user/pw inbox, but would like to use this login control.

    /Xmatt

     

  • Re: How to check for Persisted cookied when User goes to Login.aspx

    05-15-2008, 11:29 AM

    Satalaj, I think you misunderstood my question. This is what I'm looking for:

    Example:
    A user Logs In, and checks the "PersistCookie" checkbox, . .
    and is sent to Default.aspx. Later, if the User clicks a link to
    the Login.aspx page, they are sent directly back to Default.aspx,
    without having to enter ID or pw.
    Does this make sense?  thanks

     

  • Re: How to check for Persisted cookied when User goes to Login.aspx

    05-16-2008, 12:57 AM
    Answer
    • Star
      8,483 point Star
    • satalaj
    • Member since 11-28-2007, 12:41 AM
    • Pune
    • Posts 1,677
Page 1 of 1 (12 items)