Alpha Video Training
Results 1 to 5 of 5

Thread: A5ws_GetCurrentUser() and Session Time Out Behavior

  1. #1
    Member
    Real Name
    Dion McCormick
    Join Date
    Jun 2011
    Location
    Austin Texas
    Posts
    124

    Default A5ws_GetCurrentUser() and Session Time Out Behavior

    Wonder if one of the guru's could help me clarify something regarding session timeout and the current user id.

    In my system, I check to see if the session has expired by using the following code:

    if .NOT. eval_valid("session.xyz") then
    fnRefreshSession()
    end if

    On each page/dialog, I do this check first. If the primary session variable is not active then I call the "fnRefreshSession()" that re-loads the session variables from the database.

    That works fine....

    My question is how to determine the current logged in user. My current method (v11 and before) uses the ULINK session variable. Here is how I get the info:

    currentuser = session.__protected__ulink

    Now my understanding that ulink is frowned upon/going away due to IIS integration. And you should use the "A5ws_GetCurrentUser" function instead. So I placed the following line in my code.

    currentuser = A5ws_GetCurrentUser()

    Now if I call that line when the session is still valid, I get the correct user id back.

    But....if I call that line after the session has expired, I get a null value.

    I thought (and it could be a wrong assumption) is that the A5ws_GetCurrentUser() works both when the session is valid and when it has expired.

    If that is incorrect, and I am not supposed to use the ulink capability, how can I determine the user id of the current user after session time out?

    Thanks in advance.

  2. #2
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,172

    Default Re: A5ws_GetCurrentUser() and Session Time Out Behavior

    The user is logged in for the period listed in the Security Settings for login expiration. The default (and suggested) policy is to expire the login when the session expires. When the user login has expired, a5ws_GetCurrentUser() will return a blank value as no one is logged in.

  3. #3
    Member
    Real Name
    Dion McCormick
    Join Date
    Jun 2011
    Location
    Austin Texas
    Posts
    124

    Default Re: A5ws_GetCurrentUser() and Session Time Out Behavior

    Quote Originally Posted by JerryBrightbill View Post
    The user is logged in for the period listed in the Security Settings for login expiration. The default (and suggested) policy is to expire the login when the session expires. When the user login has expired, a5ws_GetCurrentUser() will return a blank value as no one is logged in.
    Thanks for the fast response. I actually have the "Login Expiration Policy" set to "Expires when the user closes their browser". I am enclosing a screen shot of the current security settings.
    5-11-2013 10-05-58 PM.jpg

  4. #4
    Former Alpha Employee JerryBrightbill's Avatar
    Real Name
    Jerry Brightbill
    Join Date
    Apr 2000
    Posts
    5,172

    Default Re: A5ws_GetCurrentUser() and Session Time Out Behavior

    They was a bug in that process in some early V12 builds. If you are using the latest V12 build, that should be working and the user should be found. However, that process relies on a tracking cookie on the client computer, so if cookies are off on that browser, the expiration policy will always be by session

  5. #5
    Member
    Real Name
    Dion McCormick
    Join Date
    Jun 2011
    Location
    Austin Texas
    Posts
    124

    Default Re: A5ws_GetCurrentUser() and Session Time Out Behavior

    Thanks for the clarification. I am going to update my solution based upon your input!

Similar Threads

  1. Getting Session Time remaining
    By roberto in forum Application Server Version 10 - Web/Browser Applications
    Replies: 20
    Last Post: 02-04-2013, 12:39 PM
  2. A5ws_GetCurrentUser
    By bobby123 in forum Application Server Version 11 - Web/Browser Applications
    Replies: 2
    Last Post: 09-05-2012, 10:49 AM
  3. How to concatenate to a5ws_getcurrentuser() to make session variable
    By Turnbullca in forum Application Server Version 11 - Web/Browser Applications
    Replies: 1
    Last Post: 07-27-2012, 12:34 PM
  4. a5ws_getcurrentuser()
    By jtm311 in forum Application Server Version 11 - Web/Browser Applications
    Replies: 22
    Last Post: 05-03-2012, 05:12 PM
  5. FYI: Session Time Out Extended for One Form
    By StephenP in forum Application Server Version 10 - Web/Browser Applications
    Replies: 0
    Last Post: 11-16-2010, 05:04 PM

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
  •