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

Session variables management within a tabbed UI with login/logout facility

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

    Session variables management within a tabbed UI with login/logout facility

    In understanding session variables and their usage, I went ahead and setup a tabbed UI app with login facility and needed to capture some data to be used elsewhere within the application upon login. Elsewhere here to mean when I open tabs that will not have been open at initial login to the application.

    The login operation sets up the following sessions

    server-side event onLogin

    Code:
    function onLogin as v (e as p)
    
    Session.Display01=1
    Session.Display02=1
    Session.Display03=1	
    
    end function

    when I open the tab named "session user", my buttons that depended on above sessions with the control similar to

    show-hide (server-side)
    Code:
    Show/Hide expression = Session.Display01=1
    This works fine upto this point. I go ahead and logout from the app, the intention here being to cancel/remove all sessions currently in place with following code

    server-side event onLogout

    Code:
    function onLogout as v (e as p)
    
    	SESSION.RESET()	
    
    end function
    I go back and re-open the tab named "session user", my buttons that depended on sessions variables still appear. Please note I am re-opening this tab after initially closing it as well as setting the "Auto refresh on focus" I did not expect this since variables are meant to have been deleted. After the 15 minutes session timeout, the variables are dropped as expected. What am I doing wrong here?

    Please find attached zip of the test app.
    session_variables.zip
    Regards,

    Kotin Karwak
    Developer Edition
    Version 12.3 Build 2684
    System Addins: Build 4438
    Build machine Windows Vista
    Skype: mateso08

    #2
    Re: Session variables management within a tabbed UI with login/logout facility

    Use:

    a5ws_logoutuser(session,request,response)
    session.clear()


    session.reset() is deprecated.
    Peter
    AlphaBase Solutions, LLC

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


    Comment


      #3
      Re: Session variables management within a tabbed UI with login/logout facility

      Originally posted by Peter.Greulich View Post
      session.reset() is deprecated.
      Really?? ...I had no idea! Good thing I read this post!
      Mike Brown - Contact Me
      Programmatic Technologies, LLC
      Programmatic-Technologies.com
      Independent Developer & Consultant​​

      Comment


        #4
        Re: Session variables management within a tabbed UI with login/logout facility

        http://wiki.alphasoftware.com/Breaki...pha_Web_Server
        Peter
        AlphaBase Solutions, LLC

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


        Comment


          #5
          Re: Session variables management within a tabbed UI with login/logout facility

          Actually, its' down on this page:

          http://wiki.alphasoftware.com/Server...+in+Version+11

          Session

          Session.Timestamp
          Session.Reset() - Use Session.Clear() as a replacement.
          Peter
          AlphaBase Solutions, LLC

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


          Comment


            #6
            Re: Session variables management within a tabbed UI with login/logout facility

            at default, the logout code is

            Code:
            function onLogout as v (e as p)
            'Fires when the user tries to logout.
            'Variables in the 'e' object include:
            'e.logoutSucceeded - either .t. or .f. depending on whether the user was successfully logged out or not.
            'e.tmpl - definition of the TabbedUI component	
            
            	
            
            end function
            should it only read

            Code:
            function onLogout as v (e as p)
            'Fires when the user tries to logout.
            'Variables in the 'e' object include:
            'e.logoutSucceeded - either .t. or .f. depending on whether the user was successfully logged out or not.
            'e.tmpl - definition of the TabbedUI component	
            
            	a5ws_logoutuser(session,request,response)	
            	session.clear()
            
            end function
            Tried this but guess I missing the point.
            Regards,

            Kotin Karwak
            Developer Edition
            Version 12.3 Build 2684
            System Addins: Build 4438
            Build machine Windows Vista
            Skype: mateso08

            Comment


              #7
              Re: Session variables management within a tabbed UI with login/logout facility

              Sorry to bump this thread. I have created a screencast to show the problem described.

              http://www.screencast.com/t/POndF24w0U

              updated zip for application follows

              session_variables.zip
              Regards,

              Kotin Karwak
              Developer Edition
              Version 12.3 Build 2684
              System Addins: Build 4438
              Build machine Windows Vista
              Skype: mateso08

              Comment


                #8
                Re: Session variables management within a tabbed UI with login/logout facility

                Kotin,

                A good practice is to dim your session variables

                Try

                dim session.Display01 as N=1
                dim session.Display02 as N=2
                dim session.Display03 as N=3

                Comment


                  #9
                  Re: Session variables management within a tabbed UI with login/logout facility

                  Kotin,

                  I looked at the ux_User component and the issue there is that you are using the server side show/hide expression of Session.Display00=1 for that first image control. Change it to Display01=1 and you can remove the Display00 session variable you are creating in the OnLogin event.

                  Also,

                  Once you enable the security framework, you need to configure the security settings for components and a5w pages . If you right click on your ux_User component and expand component security you will see that it is set to always deny users access to it. Once you change those security settings it will work as expected.
                  Attached Files

                  Comment


                    #10
                    Re: Session variables management within a tabbed UI with login/logout facility

                    Thanks Josh,
                    Tried 'dimming' the variables which as you say is a good habit but issue persists.
                    The second issue of components not opening was driving me up the wall and knew that I would kick myself once a fresh pair of eyes sees my obvious mistake.
                    I think the session variables issue will mean a rework of the workflow of the proposed application for now.
                    Thanks again for taking time to look at this.
                    Onwards and upwards!!!

                    btw, the zip file you provided, was that a backup from within Alpha? I wasn't able to open it as an import.
                    Last edited by kotinkarwak; 05-29-2015, 06:49 PM.
                    Regards,

                    Kotin Karwak
                    Developer Edition
                    Version 12.3 Build 2684
                    System Addins: Build 4438
                    Build machine Windows Vista
                    Skype: mateso08

                    Comment


                      #11
                      Re: Session variables management within a tabbed UI with login/logout facility

                      Found this command in another thread that works

                      Session.Abandon()

                      I hope it is not too big a hammer for the wee problem at hand....
                      Regards,

                      Kotin Karwak
                      Developer Edition
                      Version 12.3 Build 2684
                      System Addins: Build 4438
                      Build machine Windows Vista
                      Skype: mateso08

                      Comment


                        #12
                        Re: Session variables management within a tabbed UI with login/logout facility

                        Glad you found that session.abandon(). I confirmed that session.reset() or session.clear() do absolutely nothing when fired in that onLogout. Nether does response.redirect() but that may be intentional.

                        Personally I like to log my users in from a normal A5W page, redirect them to the tabbedui, then push them back to logout.a5w when they click a simple hyperlink to "logout" that redirect them to that page. I have more control using an A5W to front and back-end the tabbed ui, plus it looks nicer and is more intuitive.
                        Steve Wood
                        See my profile on IADN

                        Comment


                          #13
                          Re: Session variables management within a tabbed UI with login/logout facility

                          I did my own testing and found the session.clear(), session.reset(), and session.abandon() all do the same thing. Like Steve I redirect users to a logout page that then runs the logout method. I used a5w_info() and each time I logged out using a different method. Maybe the methods can not be used in a tabbed ui?
                          Mike Brown - Contact Me
                          Programmatic Technologies, LLC
                          Programmatic-Technologies.com
                          Independent Developer & Consultant​​

                          Comment


                            #14
                            Re: Session variables management within a tabbed UI with login/logout facility

                            AA developers are aware and working on this. They did however suggest using

                            dim currUser as c
                            currUser = a5ws_getcurrentuser()
                            if currUser = ""
                            session.clear()
                            end if

                            in the tabs on onTabbedUIInitialize which accomplishes the desired result.

                            Steve/Mike. I would like to explore use of separate login/logout page as suggested but believe the starting point of the application for me matters. I have to have the app show the starting page with permissible content and allow for a login as opposed to showing the login page as the starting point. Is this what you have in place?
                            Regards,

                            Kotin Karwak
                            Developer Edition
                            Version 12.3 Build 2684
                            System Addins: Build 4438
                            Build machine Windows Vista
                            Skype: mateso08

                            Comment


                              #15
                              Re: Session variables management within a tabbed UI with login/logout facility

                              Steve/Mike. I would like to explore use of separate login/logout page as suggested but believe the starting point of the application for me matters. I have to have the app show the starting page with permissible content and allow for a login as opposed to showing the login page as the starting point. Is this what you have in place?
                              Yes. Just like practically every other website on the net, you get all permissible public use content by visiting the website, and then once you login you get whatever content and resources you choose to provide to that user based on their security profile. Some developers like the TabbedUI as the "home page" but I like a "normal" web page for the public part of my website and then (for the last few years) nearly all secure content and resources inside a TabbedUI. The TabbedUI is great, but think about how many websites you visit that have that kind of structure for their public content? The answer is nearly none -- and I like my websites to look familiar to the average user. I figure someone who logged in is not such a casual user and the TabbedUI layout is fine. Also, your content in the TabbedUI (and other components) is not available to search engines, if that is important to your application.
                              Steve Wood
                              See my profile on IADN

                              Comment

                              Working...
                              X