Alpha Video Training
Results 1 to 16 of 16

Thread: Login/Logout of Alpha technical question

  1. #1
    Member
    Real Name
    Jeff Fried
    Join Date
    Aug 2000
    Posts
    589

    Default Login/Logout of Alpha technical question

    This is related to an earlier post about how to prevent more than one login to Alpha by a user (on different computers, for example).

    I already developed the technique to mark a user logged in when they open Alpha with their credentials (handled by the autoexec.scp) and mark a user logged out when they exit via the Main Menu using the Exit button.

    The question I have for anyone who has ever dealt with this capability: How do you let a user go back in to Alpha with their credentials after the computer shut down while in a session of Alpha? There is no mechanism I can think of that would mark the flag in the login file as logged out when there is a power failure, computer crash, or equivalent while the user is logged in to Alpha. I suspect it's impossible to control this. I provided an administrator with the ability to log out (i.e., update the flag) for all or selected users who experience a problem getting back in after a crash or unplanned shutdown.

    To take this even further, if you have any experience with Citrix, especially the shared desktop version, I was amazed to find out that after a timeout condition, meaning the Citrix user has been idle for, in this case, 20 minutes, when the user re-enters Citrix the Alpha session was ended -- there are no signs of an opened Alpha. Obviously, Citrix just shuts down applications when it times out. But in this case, where I depend on an orderly exit via the button on the Main Menu, the command to update the user's flag to logged out was not touched. Therefore, the user can't get back in to Alpha unless a separate mechanism is used to mark the user as logged out.

    Both of these are situations that make it impractical to use a login/logout approach. I bet this is not solvable, but if you have an answer, I would love to hear about it.

    Thank you.

    Jeff

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Login/Logout of Alpha technical question

    where I depend on an orderly exit via the button on the Main Menu
    Possibly using code registered via CAN_DATABASE_EXIT() would be a more reliable way to log them out?
    There can be only one.

  3. #3
    Member
    Real Name
    Jeff Fried
    Join Date
    Aug 2000
    Posts
    589

    Default Re: Login/Logout of Alpha technical question

    Quote Originally Posted by Stan Mathews View Post
    Possibly using code registered via CAN_DATABASE_EXIT() would be a more reliable way to log them out?
    Regardless of the way it is set up to return the flag to logged out, this is not what I'm asking about. I'm saying that if a computer crashes while a user is in Alpha, is there a way to get the flag back to logged out. If the computer crashes, then CAN_DATABASE_EXIT() has no effect.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: Login/Logout of Alpha technical question

    I was amazed to find out that after a timeout condition, meaning the Citrix user has been idle for, in this case, 20 minutes, when the user re-enters Citrix the Alpha session was ended
    I took this to mean that Citrix closed all open applications much like windows does when wanting to reboot after an update. That shutdown should trigger the can_database_exit().
    There can be only one.

  5. #5
    Member
    Real Name
    Jeff Fried
    Join Date
    Aug 2000
    Posts
    589

    Default Re: Login/Logout of Alpha technical question

    Quote Originally Posted by Stan Mathews View Post
    I took this to mean that Citrix closed all open applications much like windows does when wanting to reboot after an update. That shutdown should trigger the can_database_exit().
    I'll test this assertion and, if true, you have solved part of the problem -- a significant part.

    The other part is when there is a crash, where the shutdown is not orderly. But I'm anxious to see about this can_database_exit approach for Citrix.

    Thanks. I'll let you know what I find.

    Jeff

  6. #6
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default Re: Login/Logout of Alpha technical question

    Jeff, if its worth the effort you can build your own times out routine for each form. Could be set to time out and close the app before Citrix shuts down. Stan's idea would be easier if it works.

    I think a crash is a crash. Don't know how to update persistent storage when someone yanks the plug out of the wall (so to speak).

  7. #7
    Member
    Real Name
    Jeff Fried
    Join Date
    Aug 2000
    Posts
    589

    Default Re: Login/Logout of Alpha technical question

    Quote Originally Posted by Tom Cone Jr View Post
    Jeff, if its worth the effort you can build your own times out routine for each form. Could be set to time out and close the app before Citrix shuts down. Stan's idea would be easier if it works.

    I think a crash is a crash. Don't know how to update persistent storage when someone yanks the plug out of the wall (so to speak).
    Tom, I know what you're saying about timing out a form, but the users all have their own way of working with the app and it would be impossible to know how to time a shutdown.

    Thanks.

    Jeff

  8. #8
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default Re: Login/Logout of Alpha technical question

    I wasn't thinking of timing out all the workstations at once, just those that have been idle, with Alpha running. Would your users object to having to reload Alpha if it were to be shut down on their workstation after 15 min of idleness? what if you didn't shut it down, but simply "logged them out", forcing them to log in again, but not having to reload Alpha itself?

  9. #9
    Member
    Real Name
    Jeff Fried
    Join Date
    Aug 2000
    Posts
    589

    Default Re: Login/Logout of Alpha technical question

    Quote Originally Posted by Tom Cone Jr View Post
    I wasn't thinking of timing out all the workstations at once, just those that have been idle, with Alpha running. Would your users object to having to reload Alpha if it were to be shut down on their workstation after 15 min of idleness? what if you didn't shut it down, but simply "logged them out", forcing them to log in again, but not having to reload Alpha itself?
    Actually, I did some testing of Stan's idea to use the CanDatabaseClose instead of the way I had it set on the exit button. I tested whether Citrix session apps are closed in an orderly fashion after timing out. It turns out that Stan has it right, that Citrix shuts down the way Windows would shut down an application, and CanDatabaseClose does the trick. So this solves the problem for Citrix.

    Thank you, Stan.

    I don't think an unplanned crash or shutdown would allow CanDatabaseClose to work for restoring the flag to logged out, but I will at least test a ctrl-alt-delete to see what happens.

    Thanks.

    Jeff

  10. #10
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default Re: Login/Logout of Alpha technical question

    Hi Jeff,

    If there is actually only one Alpha Five program window on a machine (which can be determined by XBasic), and a file created during login has an earlier create date than when that Alpha Five window was started (Can be a global time variable created in autoexec), then you know that it previously crashed. On a normal exit, delete the file.
    Regards,

    Ira J. Perlow
    Computer Systems Design


    CSDA A5 Products
    New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
    CSDA Barcode Functions

    CSDA Code Utility
    CSDA Screen Capture



  11. #11
    Member
    Real Name
    Jeff Fried
    Join Date
    Aug 2000
    Posts
    589

    Default Re: Login/Logout of Alpha technical question

    Quote Originally Posted by csda1 View Post
    Hi Jeff,

    If there is actually only one Alpha Five program window on a machine (which can be determined by XBasic), and a file created during login has an earlier create date than when that Alpha Five window was started (Can be a global time variable created in autoexec), then you know that it previously crashed. On a normal exit, delete the file.
    Ira, that's an interesting concept, where time comparisons can be used to sense crashes vs normal shutdowns. Thanks for that gem.

    Jeff

  12. #12
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,643

    Default Re: Login/Logout of Alpha technical question

    to expand on Ira's idea..

    assign a guid to a global variable when Alpha starts, build the file named with the guid, record any info you want in the file.

    Delete the file when Alpha shuts down normally.

    If the file still exists after it shouldn't then you know you had a abend.

    If you build an audit trail and include the 'session' quid you'll know what happened in that session..
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  13. #13
    Member
    Real Name
    Allan Barnard
    Join Date
    Feb 2013
    Location
    Austin
    Posts
    212

    Default Re: Login/Logout of Alpha technical question

    Just a thought:

    1. Add a javascript timer on the client side. The timer can be set to ping the user's field in a table with a timestamp.
    2. On the server-side, every now and then (e.g. 5 minutes) you can check to see if the TABLE value has a recent TIMESTAMP and the SESSION exists (if you've stored session info in the table).
    3. Bottom line: if the timestamp isn't recent (e.g. 15 minutes or your own timeout value) then you can consider the original session dead and reset it. Also... if the related session is gone then clearly the main Alpha timeout has occurred or the server was restarted. Either way... that's a reset.
    4. Of course, you can also add a button that says "log me out" where it will kill other sessions.


    I'm working on a "persistent 2-week login for UX components" and some other login variants for my own situation so I'm mucking around with logins myself.

  14. #14
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,643

    Default Re: Login/Logout of Alpha technical question

    Quote Originally Posted by parkjammer View Post
    Just a thought:

    1. Add a javascript timer on the client side. The timer can be set to ping the user's field in a table with a timestamp.
    2. On the server-side, every now and then (e.g. 5 minutes) you can check to see if the TABLE value has a recent TIMESTAMP and the SESSION exists (if you've stored session info in the table).
    3. Bottom line: if the timestamp isn't recent (e.g. 15 minutes or your own timeout value) then you can consider the original session dead and reset it. Also... if the related session is gone then clearly the main Alpha timeout has occurred or the server was restarted. Either way... that's a reset.
    4. Of course, you can also add a button that says "log me out" where it will kill other sessions.


    I'm working on a "persistent 2-week login for UX components" and some other login variants for my own situation so I'm mucking around with logins myself.
    Allan

    Are you considering this a hybrid (desktop with web components) ?

    I believe the original question is related to a desktop system.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

  15. #15
    Member
    Real Name
    Allan Barnard
    Join Date
    Feb 2013
    Location
    Austin
    Posts
    212

    Default Re: Login/Logout of Alpha technical question

    I entered the thread via a search from the mobile section (v12). Didn't realize it was purely desktop-centric. However, my apps are cross platform (desktop, Android, iOS) so I use the UX components and javascript all the time even for pure browser apps.

  16. #16
    Volunteer Moderator
    Real Name
    Alan Buchholz
    Join Date
    Oct 2000
    Location
    Delavan, Wisconsin
    Posts
    9,643

    Default Re: Login/Logout of Alpha technical question

    Quote Originally Posted by parkjammer View Post
    I entered the thread via a search from the mobile section (v12). Didn't realize it was purely desktop-centric. However, my apps are cross platform (desktop, Android, iOS) so I use the UX components and javascript all the time even for pure browser apps.
    FYI - The general search looks at all forums. To look at an individual (parent or children) forum use the advanced search.
    Al Buchholz
    Bookwood Systems, LTD
    Weekly QReportBuilder Webinars Thursday 1 pm CST

    Occam's Razor - KISS
    Normalize till it hurts - De-normalize till it works.
    Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
    When we triage a problem it is much easier to read sample systems than to read a mind.

Similar Threads

  1. Web Login Question
    By TPeterson in forum Mobile & Browser Applications
    Replies: 1
    Last Post: 06-27-2013, 10:59 AM
  2. Login Form Question
    By envisionsolutions in forum Application Server Version 10 - Web/Browser Applications
    Replies: 1
    Last Post: 04-05-2010, 05:09 PM
  3. technical question
    By dik_coleman in forum Alpha Five Version 5
    Replies: 13
    Last Post: 01-04-2004, 08:22 AM
  4. MPX question FOR TECHNICAL services!
    By Tim Chapman in forum Alpha Five Version 5
    Replies: 4
    Last Post: 09-29-2003, 06:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •