Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Sudden logout from portal problem Sudden logout from portal problem
Previous
 
Next
New Post
12/1/2008 9:12 AM
 

Greetings

In my portal while the user interacts with various pages, the system suddenly logs him out, whithout him pressing logout...

This behaviour is very strange since I havent altered any other code except the Login and Logout event handlers of DNN authentication services. The only thing I added is an extra check to another database to authenticate the user that tries to login to the portal... I simply put a cookie without using any standard authentication method. Anyway the only assumption I can make is that the authentication cookie of DNN somehow expires, but I dont think this is because of my extra check... I add my code at the end of the message...

Has anyone had the same problem before (with or without code changes)? Or can anyone assume why this sudden logout happens?

Thanks in advance

Private Sub cmdLogin_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdLogin.Click

            If (UseCaptcha And ctlCaptcha.IsValid) OrElse (Not UseCaptcha) Then
                Dim loginStatus As UserLoginStatus = UserLoginStatus.LOGIN_FAILURE
                Dim objUser As UserInfo = UserController.ValidateUser(PortalId, txtUsername.Text, txtPassword.Text, "DNN", txtVerification.Text, PortalSettings.PortalName, IPAddress, loginStatus)
                Dim authenticated As Boolean = Null.NullBoolean
                Dim message As String = Null.NullString

                If loginStatus = UserLoginStatus.LOGIN_USERNOTAPPROVED Then
                    'Check if its the first time logging in to a verified site
                    If PortalSettings.UserRegistration = PortalRegistrationType.VerifiedRegistration Then
                        If Not rowVerification1.Visible Then
                            'Display Verification Rows so User can enter verification code
                            rowVerification1.Visible = True
                            rowVerification2.Visible = True
                            message = "EnterCode"
                        Else
                            If txtVerification.Text <> "" Then
                                message = "InvalidCode"
                            Else
                                message = "EnterCode"
                            End If
                        End If
                    Else
                        message = "UserNotAuthorized"
                    End If
                Else
                    authenticated = (loginStatus <> UserLoginStatus.LOGIN_FAILURE)
                End If

                Dim eventArgs As UserAuthenticatedEventArgs = New UserAuthenticatedEventArgs(objUser, txtUsername.Text, loginStatus, "DNN")
                eventArgs.Authenticated = authenticated
                eventArgs.Message = message

                'EXTRA CODE GOES HERE
                Dim userID As Long = -1
                If authenticated Then
                    Try
                        userID = 'Connect to another database, authenticate the user and get his id
                        If (userExists) Then
                            If (Request.Cookies("isAuthenticated") Is Nothing) Then
                                Dim cookie = New HttpCookie("isAuthenticated")
                                cookie.Value = userID
                                Response.Cookies.Add(cookie)
                            End If
                        Else
                            eventArgs.LoginStatus = UserLoginStatus.LOGIN_FAILURE
                            eventArgs.Authenticated = False
                        End If

                    Catch ex As Exception
                        eventArgs.LoginStatus = UserLoginStatus.LOGIN_FAILURE
                        eventArgs.Authenticated = False
                    End Try
                End If

                'Raise UserAuthenticated Event
                OnUserAuthenticated(eventArgs)
            End If

        End Sub
 

Private Sub Logoff()

            If (Not Request.Cookies("isAuthenticated") Is Nothing) Then
                Dim cookie = Request.Cookies("isAuthenticated")
                cookie.Expires = DateTime.Now.AddDays(-1D)
                Response.Cookies.Add(cookie)
            End If


            Try
                'Remove user from cache
                If Me.User IsNot Nothing Then
                    DataCache.ClearUserCache(Me.PortalSettings.PortalId, Context.User.Identity.Name)
                End If

                Dim objPortalSecurity As New PortalSecurity
                objPortalSecurity.SignOut()

            Catch exc As Exception    'Page failed to load
                ProcessPageLoadException(exc)
            End Try
        End Sub

 

 
New Post
12/1/2008 4:08 PM
 

Any page requests of type .aspx without passing the moduleID, tabID or PortalID will get you logged out.

 
New Post
12/4/2008 1:57 PM
 

I'm having the same issue where it logs me out randomly. I can't seem to purposely duplicate the problem though, it just happens when it happens it seems. I'm on DNN 4.9.

 
New Post
12/6/2008 7:01 AM
 

Well I cant explain either what is happening. I just add some pages at the menu and when browsing through them it justs logs me out randomly. The only modifications I made is the skin and the alteration at login and logout events, that I mentioned above. But I cannot specify whether this problem is a bug or it is something I am doing wrong.

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Sudden logout from portal problem Sudden logout from portal problem


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out