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

Does the Web Browser holding onto Session Variables?

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

    Does the Web Browser holding onto Session Variables?

    I have a medical web app that is using the built in security and requires everyone to log in and will assign various __protected_session_variables. That all has been working just fine for over a year now.

    However, there are a few places that have multiple users logging in at different times using the same computer. From time to time, they report having to either log in twice to gain entry or end up viewing data that was meant for the previous person who logged in last.

    It seems like the browser must be holding previous session variables - I would guess.

    So here is my question - Is there code I can add to the login or main page that will clear out any past variables to assure a clean log in each time?

    Thanks, Mike

    #2
    Re: Does the Web Browser holding onto Session Variables?

    There are several settings to check.

    For the login, go to the security configuration screen and check how the login expires setting is set. You might want to set a short time. I usually use "expires when user closes the browser", but that wouldn't work for several people using the same computer unless they are careful to close the browser after each use, and I don't think you can count on that. Maybe someone else will have a suggestion???

    Second, go to the WAS configuration settings and see how long the session time is set for. Usually the default is 900 seconds, but the first thing users complain about is having to log in again too quickly. That's a balancing act.

    Third, I've had no luck with logout pages. People tend to ignore them, so I put the logout code at the top of the login page. Again, I use a "belt and suspenders" approach and specifically delete certain session variables, then do a session reset, for example:

    delete session.__protected__UserId
    delete session.__protected__RealtorId
    delete session.__protected__AgencyId
    session.reset()

    Pat
    Pat Bremkamp
    MindKicks Consulting

    Comment


      #3
      Re: Does the Web Browser holding onto Session Variables?

      Pat, this make a lot of sense.

      I do have one question - The first page they come to when they open the website is of course index.a5w, which is the login screen - upon which takes you into the database - main.a5w screen.

      I put the code on top of the main.a5w - above where the session variables are set, but that prevented them from setting so I moved it to the top of the index.a5w.

      Seems thus far to work - that is, no errors. Is the 1st screen with the login dialog the correct page for this code?

      Thanks again for your great advice!

      Mike

      Comment


        #4
        Re: Does the Web Browser holding onto Session Variables?

        Probably what they are doing is opening a second browser window, while the first session is still active, or the first user did not log out properly. The second browser window will adopt any active session variables of the first window. Closing the browser does not close the session or remove session variables or log them off. Sessions have to expire. Even logging out does not expire the session, but it does remove the session variables IF you have session.reset() in your logout script. You can adjust Security Framework to log them out when they close the browser.

        For the problems of too-short a session timeout, you can add javascript to the header of your page that fires an alert just before their session is about to expire and tells them to refresh their page or their session will expire. You see this with your online bank, it warns you your session is about to expire.
        Steve Wood
        See my profile on IADN

        Comment


          #5
          Re: Does the Web Browser holding onto Session Variables?

          Steve - I like the idea of the java script . . . but you know what the next question is . . . . so . . . do you have such a script??

          Comment


            #6
            Re: Does the Web Browser holding onto Session Variables?

            Yes, I do.

            (Pink Panther)
            Steve Wood
            See my profile on IADN

            Comment


              #7
              Re: Does the Web Browser holding onto Session Variables?

              I had to go find it. So my server is set to 1 hour, and the alert to 55 minutes.

              <script type="text/javascript">
              setTimeout( 'ShowTimeoutWarning();', 3300000 );
              </script>

              <script type="text/javascript">
              function ShowTimeoutWarning ()
              {
              window.alert("Your browser has been idle for 55 minutes. As a security precaution your session will end in five minutes. To continue, either refresh your browser or save your page. If your session has ended, you will have to log back in." );
              }
              </script>

              You'd want this on every page, using a5w_include("header.a5w") or a5w_include("warningalert.a5w") or similar.
              Steve Wood
              See my profile on IADN

              Comment


                #8
                Re: Does the Web Browser holding onto Session Variables?

                Your da man Pink Panther! Thanks for sharing.

                MIke

                Comment


                  #9
                  Re: Does the Web Browser holding onto Session Variables?

                  Just as a follow up:

                  I am using Pat's suggestion of the session.reset() on my main page and Steve's JavaScript. I have to say, I think this really nails the problem.

                  The JavaScript is EXCELLENT - I was testing this out by leaving one of my web pages opened, exactly 55 minutes later WHILE I WAS IN ANOTHER APPLICATION, I was automatically pulled back to my web page with the warning waiting for me to hit OK. Very nice! There was no way for me to ignore it - exactly what is needed in my situation.

                  Thank you Pat and Steve - I appreciate your help and would highly recommend that people use these techniques in their web apps!

                  Comment


                    #10
                    Re: Does the Web Browser holding onto Session Variables?

                    Steve - I just had one more thought. Since the JavaScript is operating on the client side, can you see a way to enhance this a bit more by adding another timer action where by in 60 minutes (5 minutes after the warning) it automatically calls the logout screen or the login screen?

                    I noticed that even though my server sessions are set to 3600 seconds (one hour), I was still able to proceed using the database a fair amount of time after the hour of no use. I have code on every page checking for valid session variables as well but those sessions must not have expire.

                    So to be sure, it would be great if this could force the client page to go back to the login screen automatically.

                    I no nothing about JavaScripting and I am sure I could research this out but this feature is so good that I am sure others will be able to benefit from it going forward.

                    Thoughts?

                    Comment


                      #11
                      Re: Does the Web Browser holding onto Session Variables?

                      I am sure you can, and I will look later. I think you would keep the SAME javascript you already have but test when they click the OK button if the time had expired. If so, move to a different page. Actually, Security Framework should take care of that. If they are currently on a secuure page and try to refresh, it should take them to the logn page. But honestly sessions and logn 'sessions' are confusing to me too. i don't really know exactly what happens when one or the other expire.
                      Steve Wood
                      See my profile on IADN

                      Comment


                        #12
                        Re: Does the Web Browser holding onto Session Variables?

                        Coincidentally, I encountered the same issue just today. My office manager was logged in to the application and working with one data set, and then opened another instance of the browser, to login to a different data set. Well, just as Mike has pointed out, the New log in is being filtered by the former session variables. SO this thread is so timely.

                        However, I have put the code suggested by Pat at the very top of the index.a5w page, and it does not seem to kill the session variables. Here is the code that I put just below the <head> tag:

                        <%a5
                        delete session.pracid
                        delete session.userid
                        delete session.idnumber
                        session.reset()
                        a5ws_logoutuser()
                        %>

                        What am I doing wrong?

                        Gary
                        Gary S. Traub, Ph.D.

                        Comment


                          #13
                          Re: Does the Web Browser holding onto Session Variables?

                          I actually found the same thing - and even though my session lifetime is set to 3600 seconds, I find that I can go an entire day leaving the website open without any refreshes and still operate normally. I have all the above set.

                          However, on another computer I have - it all works fine as expected. Both computers have the exact same XP operating system with firefox as the browser. Not sure what the difference is and/or why the server session doesn't kill the web app after an hour.

                          I wonder if we could expand the JavaScript to clear out the browser and force the browser to a login page, if that would cure this problem?

                          Comment


                            #14
                            Re: Does the Web Browser holding onto Session Variables?

                            Hi Mike,

                            I hope as you do that there is a cure for this issue. It could really cause problems.

                            Gary
                            Gary S. Traub, Ph.D.

                            Comment


                              #15
                              Re: Does the Web Browser holding onto Session Variables?

                              You're not thinking correctly about sessions.

                              If you leave your browser open and the session expires, all session variables that YOU created will be deleted along with the session folder and its contents.

                              As soon as you refresh your page a new session folder will be created with the same name as the old one. Your session ID will NEVER have expired. It is not deleted when the session expires. It is retained in a cookie on your computer. Even closing the browser does not delete the session ID.
                              You won't notice anything at all UNLESS your application needed a value in a session variable that YOU created, but that is not repopulated when they refresh their browser. At that point it will either prompt a 500 error if you did not trap it, or follow your error trapping routine. The only way to delete the sessionID is with session.reset() (or to purge your cookies).

                              Logging out and session expiration are two different things. If you want your application to not operate when the session expires, you have to tell Security Framework to log the user out when the session expires (or after some period of time). If you tell Security to log them out when the browser closes, and they never close the browser, they are never logged out. If you include the RememberMe option, they stay logged in indefinitely (depending on your setting for that feature) unless they actually click Logout.

                              If you want your LOGIN to expire after a given amount of time, set that in Web Security Configuration.

                              -----

                              One way to test this out is to create a page that just shows your sessionID:

                              ?session.sessionID

                              Bring up your session folders in file explorer and look for a folder with that name. Wait the appropriate amount of time and the folder will be deleted. Refresh your browser, it will be recreated. If you test, be sure to set your server for at least 5 minutes. Under that it acts like it is set to an infinite amount of time.
                              Steve Wood
                              See my profile on IADN

                              Comment

                              Working...
                              X