Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

How to allow a user to only login once.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to allow a user to only login once.

    How can I force a user to log out before logging in again? I do not want them to be able to log in and then open another browser and log in again at the same time.

    Any idea's?

    Thanks
    Reed Brown
    ITOT Solutions, Inc.
    Alpha v12

    #2
    Re: How to allow a user to only login once.

    How about a field that is set to active when they log in, which gets looked at each time the login is done. If it is true then the second login cant be done.
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

    Comment


      #3
      Re: How to allow a user to only login once.

      I haven't tried this yet, but knowing that users often forget, or don't have the chance to logout gracefully,
      that you should be able to check for a session that does not have a logout time, force that session to end,
      and then continue with the user's new session.
      Gregg
      https://paiza.io is a great site to test and share sql code

      Comment


        #4
        Re: How to allow a user to only login once.

        You can't force them to log out because they can just walk away or close the browser. You can do what Keith said, but what are you going to do when they come back and that box is still checked? You can't tell them to go back to the "other" browser and properly log out because they probably already closed that browser, plus you can't really tell if they are coming back using the previous browser unless you save a cookie to their computer when they initially logged in. Until they login, you don't know who they are anyway.

        ---

        So, to ensure the same account does not login from two machines at the same time, try this (haven't tried it, just thought of it):

        You need to have a "users" table for this to work.

        When they login, save their session.sessionid to their Users table (looks like "82c9366b3aa046fe8ab8d953c3ba1ff3"). Stick some xbasic in an important A5W page or on the TabbedUI that only lets them work ONLY IF their current session.sessionid matches the one saved in the users table.

        When they log out, you don't need to do anything, you can leave the old sessionid in the users record.

        Now, if they login from a second computer THAT becomes the working session. On the other machine, the session.sessionid no longer matches the one you just stored in the user table.

        So they always can work on the most recent machine they used to login, but any previous sessions will fail.

        Edit: if on the old machine, they are working in a tabbedUI or a grid you will need to add an ajax callback to the equation to do this compare and kick them out if required.
        Steve Wood
        See my profile on IADN

        Comment


          #5
          Re: How to allow a user to only login once.

          Sounds great but way over my head.
          Reed Brown
          ITOT Solutions, Inc.
          Alpha v12

          Comment


            #6
            Re: How to allow a user to only login once.

            Which part is difficult, maybe we can help. Do your users login? If so is the login page named login.a5w? Do you have a table that stores the details of each user that can login (name, address, etc.)?
            Steve Wood
            See my profile on IADN

            Comment


              #7
              Re: How to allow a user to only login once.

              Yes I use users login. The log in page is called login.a5w. Yes I have a sql table that stores that information.
              Reed Brown
              ITOT Solutions, Inc.
              Alpha v12

              Comment


                #8
                Re: How to allow a user to only login once.

                Then try:

                - add a field to your users table named sessionid, char(32)
                - add this code to your login.a5w page. It can go at the very top (adjust to fit your sql syntax and database structure, and add error checking). This updates sessionid in their users table.

                if eval_valid("submitbutton")
                if eval_valid("userid") '== means they logged in
                dim pUser as p
                dim pUser.userid as c
                A5WS_Logged_In_User_Values(pUser)
                dim cn as sql::connection
                cn.open("::name::conn")
                vSql = "UPDATE web_users SET sessionid = session.sessionid WHERE userid='"+pUser.userid + "'"
                cn.execute(vSql)
                cn.close()
                end if
                end if
                - Create a test page to test this out. Add this to the top of that page:

                dim pUser as p
                dim pUser.userid as c
                A5WS_Logged_In_User_Values(pUser)
                if session.sessionid = sql_lookup("::name::conn","web_users","userid='"+pUser.userid+"'","sessionid")
                ?"We will let you continue."
                else
                ?"Sorry, you logged in somewhere else, this session is closed."
                end if
                - Now login from one computer and hit your test page should say "We will let you continue"
                - Go to a second computer and login, it should also say "We will let you continue".
                - Go back to the first computer and refresh the page, should tell them they logged in somewhere else.

                If all that works, then we can take the next step to apply it where needed.
                Steve Wood
                See my profile on IADN

                Comment


                  #9
                  Re: How to allow a user to only login once.

                  Can you or do you know someone that can do this for me for a fee? I always have things that need to be done and could use some help.
                  Reed Brown
                  ITOT Solutions, Inc.
                  Alpha v12

                  Comment


                    #10
                    Re: How to allow a user to only login once.

                    As a consideration to the end user, who may have been the victim of a BSOD, or may have simply forgot to close a page before leaving work (or home), wouldn't it be better to close the old session than the new session ?
                    Gregg
                    https://paiza.io is a great site to test and share sql code

                    Comment


                      #11
                      Re: How to allow a user to only login once.

                      Reed, I can do it for you tomorrow sometime. I will test out the theory first on my machine. I like this potential solution because it has a natural flow. The user probably intended to abandon the previous session, so it gets shut down if they open a new one. I've never tried to "delete a session" which has been proposed here; I'm not sure how you know which is the session you want to close. Sessions are created when someone goes to the website, even when Google indexes the site. It is not dependent upon someone logging in. Inactive sessions "delete" anyway after a period of inactivity, your session timeout.
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #12
                        Re: How to allow a user to only login once.

                        Thanks Steve. Please let me pay you for your time. Email me at [email protected]
                        Reed Brown
                        ITOT Solutions, Inc.
                        Alpha v12

                        Comment


                          #13
                          Re: How to allow a user to only login once.

                          Steve,

                          My suggestion assumes an extra field to tell if the session has ended.
                          This would give the option of checking for open sessions, and closing
                          whichever ones don't match the current session id.
                          Gregg
                          https://paiza.io is a great site to test and share sql code

                          Comment


                            #14
                            Re: How to allow a user to only login once.

                            Again, I don't know how you close an existing session, and how you know which one(s) belong to any particular individual.
                            Steve Wood
                            See my profile on IADN

                            Comment


                              #15
                              Re: How to allow a user to only login once.

                              Assume the following.
                              Log-table fields:

                              user_ID
                              sessionID
                              sessionIP
                              sess_beg
                              sess_end


                              My logic would check the log-table for an active session before logging the user in.
                              If a session exists, clear and/or logout the user, then allow the login procedure to continue.

                              I have not confirmed this will work, but the logic seems to be right.
                              Gregg
                              https://paiza.io is a great site to test and share sql code

                              Comment

                              Working...
                              X