Alpha Video Training
Results 1 to 3 of 3

Thread: eval_valid(session.myVar) randomly fails during multi a5w page login under AA IIS

  1. #1
    "Certified" Alphaholic
    Real Name
    Rich Fulham
    Join Date
    May 2011
    Location
    Portland, OR
    Posts
    1,018

    Default eval_valid(session.myVar) randomly fails during multi a5w page login under AA IIS

    Myself and two other users have observed eval_valid("session.MyVar") return .F. during a multi-page login process for a session variable that has already been created on a previous a5w page.

    I have Alpha's Login component configured to call an "intermediate" login page (Page_B) that sets some session variables using something like "session.myVar = some_xbasic_variable". That intermediate page calls a page (Page_C) that hosts a Grid. When the user clicks a button on a Grid row, an ajax callback is made. That callback has something like this at the top:

    Code:
    '-- Validations
    select
        case eval_valid("session.myVar") = .f.
            mRetMsg = "Error 1, blah, blah, blah"
        case eval_valid("session.myVar2") = .f.
            mRetMsg = "Error 2, blah, blah, blah"
        case ..... '-- other validations
        case else
            '-- all okay.  Set remaining session variables
    end select
    '--- If validation error then return an alert message
    '--- Else  return "location.href = apps_main_page.a5w"
    On rare occasion the grid displays the "Error 1..." when the user clicks the button for the callback.

    Why would it be that sometimes the AA web server under IIS forgets a session variable or thinks"eval_valid("session.myVar") is .F. ?

    When this happened to me this morning, I checked all the error logs and could find nothing, except the "favicon" link in the login page was missing a "?" between the icon name and the random number argument. This was triggering an error in the event log about the bad URL path. But that occurred 3 minutes before I clicked the button on Page C.

    Since discovering the above error, I have changed "eval_valid" to "variable_exists" and I have altered the code to guarantee the variables are indeed being set to CHAR types. The db fields are UNIQUEIDENTIFIER types in MS SQL and they appear as type CHAR when using "rs.data("myColumn") from a resultset on localhost. But to be sure there is no problem between the two types, I put a CONVERT(varchar(40), myColumn) on each of the GUID columns.

    Build 5303 (Dev and server)
    Session state is being held in ASP.NET SQL Provider
    There is no config for session timeout on the publishing profile - I do not see any type of config option in profile.

  2. #2
    "Certified" Alphaholic
    Real Name
    Rich Fulham
    Join Date
    May 2011
    Location
    Portland, OR
    Posts
    1,018

    Default Re: eval_valid(session.myVar) randomly fails during multi a5w page login under AA IIS

    So, a couple days later now, after making absolutely sure the UNIQUEIDENTIFIER column from SQL is being returned and used as CHAR in xbasic, I am now noticing a problem with a different session variable - a session variable that gets set later on in my multi-page login process. I have started a different thread about it here:
    https://forum.alphasoftware.com/show...S-(build-5303)

  3. #3
    "Certified" Alphaholic
    Real Name
    Rich Fulham
    Join Date
    May 2011
    Location
    Portland, OR
    Posts
    1,018

    Default Re: eval_valid(session.myVar) randomly fails during multi a5w page login under AA IIS

    I may have discovered the cause for the random failure: Sometimes Alpha WAS and Alpha IIS calls your "Redirect Page - Login" even when the user is logged in, the user won't see that page, but if that page has code to delete session variables then they will probably vanish on you. I posted my findings here: https://forum.alphasoftware.com/show...ample-attached

    Oh, but as pointed out in someone else's post, session variables may always be susceptible to timing issues on the server. I think this is especially true if session variables are being held in a SQL database on a separate server from the web server! Totally defeats the purpose of having session variables held in SQL if they cannot be read back by the time the person posts another request to the server.

Similar Threads

  1. Replies: 5
    Last Post: 10-28-2015, 05:34 AM
  2. Session variable not passing back to page unless I reload the page after login
    By jwilliamson in forum Mobile & Browser Applications
    Replies: 6
    Last Post: 08-14-2015, 01:18 PM
  3. How can I redirect user to login page when session times out?
    By Jay Talbott in forum Application Server Version 11 - Web/Browser Applications
    Replies: 6
    Last Post: 05-31-2013, 01:36 PM
  4. Web page displays for 3-4 seconds then returns to login page
    By perry99 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 2
    Last Post: 09-09-2011, 12:21 AM
  5. Multi-page report with totals for each page.
    By James Merryfield in forum Alpha Five Version 4
    Replies: 11
    Last Post: 02-07-2003, 10:07 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
  •