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

Do "ALL" session vars expire at the same time?

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

    Do "ALL" session vars expire at the same time?

    I have several locations within my app which use eval_valid() to test the validity of certain session vars. Each validity check determines whether certain menu options or other user options or events are made available.

    For some reason some session vars seem to pass the eval test while my main session var seems to have expired. For example if my main session var is assigned at the opening of the app ( session.main_office_id ). Maybe ten minutes later, I assign the vars ( session.did_printletter_1 ) and (session.have_selected_color).

    Shouldn't eval_valid() return true for session.main_office_id WHENEVER eval_valid() returns true for session.have_selected_color ?

    This only seems to be a concern when the app is allowed to sit "idle" for some time (maybe 60 minutes etc - my setting).

    In other word's - Do "ALL" session vars expire at the same time?

    Also, under what circumstances would my a5 code show up in my browser window literally-
    <%a5 ? eval_valid("session.main_office_id") %>

    This kind of code exposure seems fairly reckless and dangerous to the developer. Any thoughts?

    #2
    Re: Do &quot;ALL&quot; session vars expire at the same time?

    You may be getting false readings due to how your application is configured, how you set session variables. The best way to determine what Vars exist is to create an A5W page with ONLY the following:

    <%a5
    ?a5w_info()
    %>

    and fire that page to view all session vars that exist at the time of your test.

    All session vars are deleted when the session expires, but depending on your configuration, some of them can be recreated the moment you refresh a page in your application. The purpose of setting the above function on a blank A5W page is to ensure the page is not also setting other session vars when it is refreshed.

    Also, under what circumstances would my a5 code show up in my browser window literally-
    <%a5 ? eval_valid("session.main_office_id") %>

    This kind of code exposure seems fairly reckless and dangerous to the developer. Any thoughts?
    It may appear if your page was not named with the A5W extension. It would appear if you were opening the HTML or A5W page directly in a browser with Alpha Five WAS not running.
    Steve Wood
    See my profile on IADN

    Comment


      #3
      Re: Do &quot;ALL&quot; session vars expire at the same time?

      Originally posted by Steve Wood View Post
      All session vars are deleted when the session expires, but depending on your configuration, some of them can be recreated the moment you refresh a page in your application.
      Steve,

      Thanks for your verbose reply to my question, however it inadvertently may be pointing out the "potential problem" that I thought I may be experiencing.

      Your statement:

      "some of them can be recreated the moment you refresh a page in your application" is what is at issue.

      Let me try to explain:

      If session.var1 and session.var2 are 20 minutes "old" and a new session var is NOW created, do ALL the session vars become the "SAME AGE". In other words, are session.var1 and session.var2 suddenly "refreshed" with new life because a server event has taken place? (ie. no new values are stored to these vars at this event)

      Tom W.

      Comment


        #4
        Re: Do &quot;ALL&quot; session vars expire at the same time?

        Originally posted by Steve Wood View Post
        It may appear if your page was not named with the A5W extension. It would appear if you were opening the HTML or A5W page directly in a browser with Alpha Five WAS not running.
        Steve,

        On the second part of my question, here is added info.

        I have literally seen pages rendered where a grid or grids where displayed properly, YET my <%a5 .... %> code was ALSO written to the page in plain text.

        Obviously the WAS must be running if the grids displayed. This only occurs when some session var has expired or event has taken place that is rare but is repeatable. All I have to do is go to a page deep within my app and let the app just sit there for 4 hours or more. If I then come back home and click on a button on that "viewable" page, the action may cause a partial display of the good with the bad.

        Tom W.

        Comment


          #5
          Re: Do &quot;ALL&quot; session vars expire at the same time?

          Tom,

          You may have to show a video or share the at issue grid and provide an example. Exactly where is that code? It must be in some freeform area, field labor or such, or perhaps a text area field as part of a table record.
          Steve Wood
          See my profile on IADN

          Comment


            #6
            Re: Do &quot;ALL&quot; session vars expire at the same time?

            If session.var1 and session.var2 are 20 minutes "old" and a new session var is NOW created, do ALL the session vars become the "SAME AGE". In other words, are session.var1 and session.var2 suddenly "refreshed" with new life because a server event has taken place? (ie. no new values are stored to these vars at this event)
            Well, to "create" a new session variable you have to hit the server. So in an indirect way, Yes, if you create a new session var you will have "refreshed" the session and all variables will have a new lifespan equal to the session timeout set on the server config.
            Steve Wood
            See my profile on IADN

            Comment


              #7
              Re: Do &quot;ALL&quot; session vars expire at the same time?

              In V12 I have been noticing code that I thought used to work with eval_valid() for testing variable existence wasn't working as I thought it did under V11. I have been switching eval_valid() out with "variable_exists()". It think it works better for that purpose and Alpha says it is a lot more efficient.

              I keep the timeout setting pretty low on my development application server, so I can see what happens readily on session timeout. Timeout is a huge problem because of the number of things that continue to work, perhaps due to cached pages and components. When component security is turned on, isn't there a way to configure the application server to redirect to a special page when it receives a request from a timed-out session?

              On another note about session variables - I do not see why Alpha continues to demonstrate their use as a means to pass temporary information from one component to the next in some of their training videos. If the user can open two or more instances of the same component, like if everything is opened in a tab on the tabbed-UI, then the session variables are useless unless you make certain you capture and use the session variable's value as it existed when that instance was opened AND you take measures to ensure the session variable really is re-initialized and not using an old value from the cached component.
              What Alpha has done in the Action Javascript for calling a Dialog2/UX component where "arguments" can be defined dynamically and then picked up in the OnDialogInitialize with "argval(e.arguments, "My_Argument")" works well for me, so far. Now if they would just make that work when calling a Grid component!

              -Rich F.

              Comment


                #8
                Re: Do &quot;ALL&quot; session vars expire at the same time?

                Originally posted by RichCPT View Post
                In V12 I have been noticing code that I thought used to work with eval_valid() for testing variable existence wasn't working as I thought it did under V11. I have been switching eval_valid() out with "variable_exists()". It think it works better for that purpose and Alpha says it is a lot more efficient.
                A follow up to efficiency, Alpha doesn't encourage using eval_valid() for testing session variables for performance reasons. They suggested instead that you assign your session variable to a local variable and test for null:

                Code:
                dim test as c = session.some_var
                
                if (.not. isNull(test)) then
                  ' do things
                end if
                Alpha Anywhere latest pre-release

                Comment


                  #9
                  Re: Do &quot;ALL&quot; session vars expire at the same time?

                  Originally posted by TheSmitchell View Post
                  A follow up to efficiency, Alpha doesn't encourage using eval_valid() for testing session variables for performance reasons. They suggested instead that you assign your session variable to a local variable and test for null:

                  Code:
                  dim test as c = session.some_var
                  
                  if (.not. isNull(test)) then
                    ' do things
                  end if
                  Sarah,

                  I tried your code as written and found it to be a non workable example.

                  The reason is, if session.some_var is not yet valid. an error will occur: "subelement session.some_var not found".

                  Therefore unless I'm missing something, you can not use this method to test for a valid session var. I have always used eval_valid() but from the comments above, I am now trying variable_exists(). Don't know technically what the difference is, but I'd like to use the best function available.

                  Tom W.

                  Comment


                    #10
                    Re: Do &quot;ALL&quot; session vars expire at the same time?

                    Another option, one that I use quite a bit, is to use the DEFAULT keyword and dim the variable in your code.

                    Code:
                    DIM session.myvar as c = DEFAULT ""  'if it exists, nothing happens, if not, it gets created with value you supply
                    
                    If session.myvar = "" then
                    	'session.myvar has not been set from somewhere else
                    else
                    	'session.myvar has been set from somewhere else	
                    end if
                    Jim Coltz
                    Alpha Custom Database Solutions, LLC
                    A5CustomSolutions.com
                    [email protected]

                    Comment


                      #11
                      Re: Do &quot;ALL&quot; session vars expire at the same time?

                      variable_exists() is the "recommended" method last I heard from Jerry Brightbill.
                      Peter
                      AlphaBase Solutions, LLC

                      [email protected]
                      https://www.alphabasesolutions.com


                      Comment


                        #12
                        Re: Do &quot;ALL&quot; session vars expire at the same time?

                        Originally posted by Fulltimer View Post
                        Sarah,

                        I tried your code as written and found it to be a non workable example.

                        The reason is, if session.some_var is not yet valid. an error will occur: "subelement session.some_var not found".

                        Therefore unless I'm missing something, you can not use this method to test for a valid session var. I have always used eval_valid() but from the comments above, I am now trying variable_exists(). Don't know technically what the difference is, but I'd like to use the best function available.

                        Tom W.
                        Yep. It was an example. If your session variable isn't defined, accessing it causes an error. You'll have to replace "some_var" with whatever your session variable is named - assuming it exists. If it doesn't exist, your back to testing session using eval_valid or variable_exists. Though, I like Jim's suggestion to use DEFAULT. I never thought to do that.
                        Alpha Anywhere latest pre-release

                        Comment

                        Working...
                        X