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

Session variable question

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

  • Session variable question

    I received an email from Amy Gorden and the article is about Lee Vasic a featured developer for Q4 on IADN, and in one of his tips (pls see attached file) , he mentioned
    something about avoiding session variable and instead use arguments. I got confused and a bit worried because I used session variables extensively in my app.

    How do I automatically logout the app after 15 minutes? or how to automatically logout the app if I close the browser?

    Thanks!
    Attached Files

  • #2
    Re: Session variable question

    Actually I am not sure what is the actual question here. But I assume it has something to do with the picture attached. If so then LV is maybe referring to the new feature in Alpha so when you define an argument (and then an array argument) in UX you can now bind it to the logged in user id (or group) in security. In Alpha Anywhere Demo some time ago Selwyn was ready to explain more of this topic but unfortunately time run out.

    Or maybe LV means something else.

    Comment


    • #3
      Re: Session variable question

      Hi Kenneth, THanks for the reply, Based on the image attached, I encircled the "dont use session variables" what is then the best way or alternative?

      Comment


      • #4
        Re: Session variable question

        I do not see any problems with session variables in a web application. Mobile is an other thing.

        Comment


        • #5
          Re: Session variable question

          Thanks for the clarification Kenneth.

          Comment


          • #6
            Re: Session variable question

            Sorry, but I disagree with Ken. Session variables are fraught with problems. Maybe he has a web application that works with session variables, but I wonder... Is it me or Ken that is in the minority here. Just search this newsgroup for "Session variable".

            Another thing to do is make sure you have xbasic logging turned on in a test application (or maybe even your production app, if you don't have too many users) and then periodically check the log for "Property not found" where a session variable is involved. Three times today, my production server randomly "forgot" about a particular session variable (or it did not have time to finish saving the variable before it was needed by the next page). I started a new xbasic log on Nov 28. From then until Jan 8, this error has occurred 30 times. Now, it is possible the users really did timeout (or at least their session variables timed out), but since I have seen this error happen to me and because of the page this error happens on, I would say it is a real error.

            Comment


            • #7
              Re: Session variable question

              Originally posted by RichCPT View Post
              Sorry, but I disagree with Ken. Session variables are fraught with problems. Maybe he has a web application that works with session variables, but I wonder... Is it me or Ken that is in the minority here. Just search this newsgroup for "Session variable".

              Another thing to do is make sure you have xbasic logging turned on in a test application (or maybe even your production app, if you don't have too many users) and then periodically check the log for "Property not found" where a session variable is involved. Three times today, my production server randomly "forgot" about a particular session variable (or it did not have time to finish saving the variable before it was needed by the next page). I started a new xbasic log on Nov 28. From then until Jan 8, this error has occurred 30 times. Now, it is possible the users really did timeout (or at least their session variables timed out), but since I have seen this error happen to me and because of the page this error happens on, I would say it is a real error.
              So is your point here that session variables are broken in Alpha platform?

              Comment


              • #8
                Re: Session variable question

                Rich: Have you cross referenced the other logs to investigate the "Property not found" issue?

                I use session variables in all the apps I've worked on successfully. All web apps I might add.
                Mike Brown - Contact Me
                Programmatic Technologies, LLC
                Programmatic-Technologies.com
                Independent Developer & Consultant

                Comment


                • #9
                  Re: Session variable question

                  As long as you are still in-session....then session variables are great. Alpha does have capability of working out-of-session though, and that could be the issue (for example, an app that must work in disconnected mode). We are using Arguments more now as it's more consistent between application types (for example - you need something to work on mobile and web and want to reuse the component from within a different interface).

                  Comment


                  • #10
                    Re: Session variable question

                    A session variable should be treated no differently than any other type of variable. You cannot depend on them being available where you want it or when you want it. You must be diligent and test session variables whenever they are to be used. If they are not available or not set with a value you're expecting then your code takes steps to establish the variable or set their values.

                    This only applies to web applications. Session variables should never, and need ever, be used in a mobile application.

                    Comment


                    • #11
                      Re: Session variable question

                      Concerning UX components, the user might use the application for awhile without doing any AJAX callback or any other call to the server. So after 15 or 20 minutes... you've lost your session and session variables. Not really an Alpha issue; it is just not a good idea to use session variables with larger, "single page" web/mobile apps where the users will "randomly" lose their sessions.

                      Comment


                      • #12
                        Re: Session variable question

                        Although you can build a web application without session variables there is no problem using them and they are very convenient. But you have to understand that they are tied to a particular user and that they will expire, appropriately, when the user's session expires (that is a good thing). A user's session is just based on their browser having hit the website, and is fundamentally independent of their logged-in status but you can tie those two things together in Security Framework so that when the user's session expires, they are also logged out. And, when a person logs out, the session variables are all destroyed. To me it would not make any sense to set a session variable other than for a logged in user. What is the purpose, it will expire when that user abandons their browser for the 'session timeout' period. In my largest web applications I have five session variables and the same ones in my smallest application. They are convenient, like setting session.fullname to the logged in user's name so I can display it here and there. But it is very important that this is tied to them being logged in and if by some mystery not related to their session timeout their session variables disappear (has never happened), I reset them to their proper values when the screen is refreshed. But again, they are tied to the user being logged in only.
                        Steve Wood
                        Join the ALPHA DEVELOPERS NETWORK
                        There is no Cloud. It's just someone else's computer.
                        Web - Mobile - Hosting - Products - Frameworks - Developer Resources
                        AlphaToGo | IADN (100% Alpha Anywhere Websites)

                        Comment


                        • #13
                          Re: Session variable question

                          I think one of the issues with session variables is the following. Let's say a user logs into your app, and selects a particular company Id to work with, then wants to see the customers in that company. A session variable is set with the company id. All is good, but if the user opens another browser tab, logs in and selects a company to look at. The the session variable from the second tab overwrites the first tabs session variable.
                          Am I confused about this?

                          I would have thought that a different tab with a fresh login would have created separate session variables.

                          Comment


                          • #14
                            Re: Session variable question

                            Yes that is true, session vars are shared on the browser between tabs when on the samr application. They would even be shared if you were on two different Alpha applications, one in each tab. And, some people run multiple Alpha apps (on the same IP and port) using subfolders for each one where session vars from the app in /folder1 are shared with the app in /folder2.
                            Steve Wood
                            Join the ALPHA DEVELOPERS NETWORK
                            There is no Cloud. It's just someone else's computer.
                            Web - Mobile - Hosting - Products - Frameworks - Developer Resources
                            AlphaToGo | IADN (100% Alpha Anywhere Websites)

                            Comment


                            • #15
                              Re: Session variable question

                              Yes and therefore we have possibility to run different instances of Application server in different ports and/or IP. With reverse proxy in front of Alpha the url is still myserver.com/app1 and myserver/app2. Or we can run them from different domain like myapp1.myserver.com and myapp2.myserver.com again using reverse proxy.

                              Ken

                              Comment

                              Working...
                              X