Results 1 to 3 of 3

Thread: Distinguish between browser close/refresh/back events for a secure site (asp.net 2.0)

  1. #1
    Join Date
    Feb 2009

    Distinguish between browser close/refresh/back events for a secure site (asp.net 2.0)

    This is a question I have also been trying to answer (and mainly finding only posts related to disabling back button navigation or doing a check if not the most recent page in browser history then tell the browser to go forward again, which is either ineffective or degrades user experience).

    Basic premise of the issue is:

    1. User logs into secure application.

    2. User views sensitive data.

    3. User (not knowing any better) leaves browser window open (even though they may have closed the Tab that was displaying the website, or navigated to a page outside of the site).

    4. User or Second User opens new tab and either:
    a. uses history to return to previous page containing sensitive data, or
    b. types url of login page to web app, but due to persistence of asp.net (http-only) session cookie (not accessible to client side script), is automatically returned to the logged in page of the previous user displaying sensitive data.

    If it is the same user who finds themselves still logged in, this may affect their perception of site security. If it is a separate user who views this data, then in this particular application, that would be a breach of confidentality and data protection).

    I checked a few different 3rd party secure sites (e.g. online bank) and so far found 2 that have solved the issue (and one that had not) - for major browsers (assuming both javascipt and cookies are available, otherwise they probably dont allow access).

    I think that using a combination of a frameset, cookies set/expired appropriately by onload and onunload events on both frameset and content frame, and javascript to detect if the url causes inner frame to break out of the frameset - it is possible to acheive the desired automatic sign out while still distinguishing between initial site load and subsequent navigation within the site versus a full page reload, but I cannot yet see how to separate an F5/Refresh when the user has not left the page from a navigation away to external site and return to the original site via history or back button.

    Any suggestions gratefully received..

  2. #2
    Join Date
    Apr 2003
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Feb 2009
    Thanks - lots of useful info in there..

    I had a look at the headers in Firebug:

    Response Headers
    Server Microsoft-IIS/5.1
    Date Tue, 24 Feb 2009 19:59:58 GMT
    X-Powered-By ASP.NET
    Cache-Control no-cache, no-store
    Pragma no-cache
    Expires -1
    Content-Type text/html; charset=utf-8
    Content-Length 656

    which I think is acheiving the desired effect, though I see that the pragma no-cache is listed as deprecated.

    The only thing I have not now managed to do regards the functionality I discussed was allowing the user to click their browser refresh button and remain in the site.
    However, having checked a couple of third party sites that manage to detect and silently log out the user as they navigate away to an external link and not offer to resubmit the form when the same entry is loaded from the browser history before the session has expired while still allowing browser back/forward button navigation to work internally within the site - as I now do, I have found that in each case they also either return the user to the login page when the browser refresh button is clicked (as mine does) or in some cases redirect to an error page.
    I guess it's a compromise I can accept.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.09895 seconds
  • Memory Usage 2,858KB
  • Queries Executed 15 (?)
More Information
Template Usage (32):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (3)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (73):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates