issues verifying if user is logged in
Posted on
16th Feb 2014 07:03 pm by
admin
I am having issues when a user logs in via asp Login control, the IsAuthenticated still seems to come up false... ( yes the username and password is correct)
Can anyone tell me what I might be missing ?
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
setupForm()
If (Page.IsPostBack) Then
'Dim loggedIn As Boolean = HttpContext.Current.Request.IsAuthenticated
End If
If (Not Page.IsPostBack) Then
'Popup dialog won't fire if user is already in.
If (Request.IsAuthenticated) Then
mpeLogin.Enabled = False
pnLogin.Visible = False
logStatus.Visible = True
logName.Visible = True
Else
mpeLogin.Enabled = True
pnLogin.Visible = True
logStatus.Visible = False
logName.Visible = False
End If
End If
End Sub
Private Sub setupForm()
' set the Login control properties
lgLogin.CreateUserText = _JoinNowText
lgLogin.CreateUserUrl = _JoinNowURL
lgLogin.PasswordRecoveryText = _PasswordRecoveryText
lgLogin.PasswordRecoveryUrl = _PasswordRecoveryUrl
lgLogin.InstructionText = _InstructionText
lgLogin.HelpPageText = _HelpPageText
lgLogin.HelpPageUrl = _HelpPageUrl
lgLogin.DestinationPageUrl = _DestinationPageUrl
lgLogin.RememberMeSet = _RememberMeSet
lgLogin.RememberMeText = _RememberMeText
pnLogin.CssClass = _LoginPanelCss
lblBeforeButton.Text = _LoginPanelLabel
pnLogin.Width = _LoginPanelWidth
End Sub
'Continue to display the popup dialog and failure text if login failed.
Protected Sub lgLogin_Authenticate(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.AuthenticateEventArgs) Handles lgLogin.Authenticate
Dim name As String = HttpContext.Current.User.Identity.Name
'Add authentication logic here.
'e.Authenticated = ((lgLogin.UserName = "gbeford") And (lgLogin.Password = "spring!"))
e.Authenticated = HttpContext.Current.Request.IsAuthenticated
Dim test As Boolean = HttpContext.Current.User.Identity.IsAuthenticated
Dim isLoggedIn As Boolean = FormsAuthentication.Authenticate(lgLogin.UserName, lgLogin.Password)
If (Not e.Authenticated) Then
mpeLogin.Show()
End If
End Sub
No comments posted yet
Your Answer:
Login to answer
67
27
Other forums
Multi Level Array Problem
hi all,
For example I have array like below:
$temp = array(array('north america', 'us'
Problem with PHP/mySQL login code
Hello,
There is an error in my login script and I can't figure out what it is...
I believe
PHP SUBMIT
Code: <input name="doLogin" type="image" src="images/loginsubmit.jpg
Phase Error I can't seem to find :(`
Hey guys, I can seem to find my phase error on this. I am getting this error
[error]
Pars
adding 0 to numbers
Hey guys i need to create a 00001 number in a loop. Is there a better way of forcing a 5 digit numbe
help with calculations on a flat text file
hello,
I have this code below that is attached to a flat file like this:
Email:LastName:FirstN
Sorting JTable on more than just the values listed in the columns
I have a collection of objects that store (among other things) two integer values. I only want to di
Call to undefined function mysql_fetch_accoc()
New to php/mysql coding. What's wrong with this sequence, or am I
just not seeing to obvious?
Save file by click
Hello.
I'm not understand how to save file from page. I'd like make link to file with save abil
Displaying data from database into a 2 dimensional table
Good day!
I'm a beginner in PHP and I'm not expecting a full coding for this qestion. I'm jus