Attempt at creating the infamous WEB LOGOFF button...

Discussion in 'ASP .Net Security' started by dsl, Oct 19, 2003.

  1. dsl

    dsl Guest

    I'm a newbie (at this stuff anyway) - working with WIN2K server and
    Sharepoint Team Services, working at creating an intranet... and looking for
    a way to allow users to "log off" via a log off button for shared use of
    individual computers throughout the day...

    In browsing through various web resources, I came across an article for
    creating a "browser.ocx" file, and using it with a little code to create the
    log off effect.

    Well, I created the .OCX per the instructions, registered it with regsrv32,
    added the test1.htm page to the root of my web, and tested it.

    I got the logoff button to appear ;-) ...(hey I'll take what I can
    get...)... but the report of errors on the page. Before hitting the button,
    an error:

    "Automation server can't create object"

    ....and after hitting the button,

    "'obj1' is null or not an object"

    Any thoughts on this? For the sake of having any chance to answer this, I'm
    splicing in the guts of the post I used below.
    I currently have the web set for basic authentication, NO anonymous access,
    but originally had it set with both basic AND windows authentication. Still
    not sure where I'm going with that yet.

    Any thoughts greatly appreciated...


    Original message:
    =========================================

    From: "Joseph Geretz" <>
    Date: Sun, 9 Mar 2003 23:29:13 -0500

    Hi Luc,

    Thanks for the tip.

    > http://support.microsoft.com/default.aspx?scid=KB;en-us;q195192
    >
    > (clients have to download OCX, though...)


    This actually works. It's not even that big a deal to code.

    --------------
    Option Explicit

    Const END_BROWSER_SESSION = 42

    Private Declare Function InternetSetOption Lib "wininet.dll" _
    Alias "InternetSetOptionA" _
    (ByVal hInternet As Long, _
    ByVal lOption As Long, _
    ByRef sBuffer As Any, _
    ByVal lBufferLength As Long) _
    As Integer

    Public Function FlushCredentials() As Integer

    FlushCredentials = InternetSetOption(0, END_BROWSER_SESSION, 0, 0)

    End Function

    --------------
    <script language=javascript>
    <!--
    var logoff = new ActiveXObject("browser.logoff");
    var x = logoff.FlushCredentials();
    //-->
    </script>
    --------------

    However, I'm not thrilled about having to rely on a client hosted ActiveX.
    Is it possible to do this by working directly with the browser DOM via
    javascript?

    Thanks,

    - Joe Geretz -

    Next message: [MSFT]Allen: "RE: running app under custom account"
    Previous message: Mike Bourne: "128 Bit encrytin problem with ASP.NET (VB)"
    In reply to: Luc Kumps: "Re: How to provide Log Off for a Web Application?"
    Next in thread: Luc Kumps: "Re: How to provide Log Off for a Web
    Application?"
     
    dsl, Oct 19, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas
    Replies:
    0
    Views:
    455
    Thomas
    Sep 7, 2005
  2. Mark A. Odell

    Q: Type'ing the infamous 'flags' field

    Mark A. Odell, Sep 16, 2004, in forum: C Programming
    Replies:
    13
    Views:
    481
    Dave Thompson
    Sep 23, 2004
  3. Eigenvector

    The infamous ^Z problem

    Eigenvector, May 23, 2007, in forum: C Programming
    Replies:
    15
    Views:
    735
    Keith Thompson
    May 24, 2007
  4. Cowboy \(Gregory A. Beamer\)

    Re: when i press enter, logoff button is pressed

    Cowboy \(Gregory A. Beamer\), Jan 27, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    455
    Cowboy \(Gregory A. Beamer\)
    Jan 27, 2009
  5. GMI
    Replies:
    3
    Views:
    518
    Tad McClellan
    Jun 19, 2005
Loading...

Share This Page