[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

cannot login from firefox- asp.net login functionality

Asked by manivineet in Programming for ASP.NET, .NET, Microsoft Visual Basic.Net

This is so freaking strange,

When I try to login using Firefox, I get a default error message (which I have set in the _LoginError sub)

the thing is the when I login using a particular username(in my case 'test'), i can login from IE but not firefox

All other logins work fine in both browsers

have tried rebooting the PC, clearing cookies, removing temp asp.net files.

following is the code, i use this code to use the remember me funcitonality

p.s. safari for windows doesnt throw this problem, only Firefox
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
Private Sub portalLogin_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles portalLogin.Init
        If Not IsPostBack Then
            If Request.Cookies("myCookie") IsNot Nothing Then
                Dim cookie As HttpCookie = Request.Cookies.[Get]("myCookie")
                portalLogin.UserName = cookie.Values("username")
 
                portalLogin.RememberMeSet = (Not [String].IsNullOrEmpty(portalLogin.UserName))
            End If
            Dim txtUser As TextBox = TryCast(portalLogin.FindControl("UserName"), TextBox)
            If txtUser IsNot Nothing Then
                'Me.SetFocus(txtUser)
            End If
        End If
 
        ' Note this
        Response.Cache.SetNoStore()
 
    End Sub
 
    'redirect the user to the HOME page when he logs in
    Private Sub portalLogin_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles portalLogin.LoggedIn
        'get user name
        Dim usern As String = portalLogin.UserName.ToString
 
        Dim myCookie As New HttpCookie("myCookie")
        Dim remember As Boolean = portalLogin.RememberMeSet
 
        If remember Then
            Dim persistDays As Int32 = 60 'cookie set toe expire in 60 days
            myCookie.Values.Add("username", portalLogin.UserName)
            myCookie.Expires = DateTime.Now.AddDays(persistDays)
            'you can add years and months too here
        Else
            myCookie.Values.Add("username", String.Empty)
            ' overwrite empty string is safest
            myCookie.Expires = DateTime.Now.AddMinutes(5)
            'you can add years and months too here
        End If
 
        Response.Cookies.Add(myCookie)
 
        
        
    End Sub
 
 
    Protected Sub portalLogin_LoginError(ByVal sender As Object, ByVal e As System.EventArgs) Handles portalLogin.LoginError
        'determine why the user could not login...
        portalLogin.FailureText = "Your login attempt was not sucessful. Please try again"
 
        'does that user account Exist ?
        Dim usrInfo As MembershipUser = Membership.GetUser(portalLogin.UserName)
 
 
        If usrInfo IsNot Nothing Then
            'is this user Locked out?
            If usrInfo.IsLockedOut Then
                portalLogin.FailureText = "Your account has been locked out because of too many invalid login attempts. Please contact administrator to re-activate it"
 
                'has user been Approved yet?
            ElseIf Not usrInfo.IsApproved Then
                portalLogin.FailureText = "Your account has not been approved yet. You cannot login until an administrator has approved your account"
            End If
 
        End If
    End Sub
[+][-]03/17/09 06:27 AM, ID: 23907647Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/19/09 12:59 PM, ID: 23933464Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03/21/09 06:19 PM, ID: 23949750Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Programming for ASP.NET, .NET, Microsoft Visual Basic.Net
Sign Up Now!
Solution Provided By: manivineet
Participating Experts: 2
Solution Grade: A
 
 
Loading Advertisement...
20091111-EE-VQP-89 - Hierarchy / EE_QW_3_20080625