#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    4
    Rep Power
    0
    How can I close a users browser when required - with out needing confirmation from the User ?

    Is this possible ?

    I need to close users down after a time out period.

    Thanks

    Nick
  2. #2
  3. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Colchester, England
    Posts
    131
    Rep Power
    14
    I glanced over an article in the MSDN newspaper with a similar question. One of the solutions was to redirect the browser to a "logoff" page after a set time of inactivity (refresh to a new location). I will dig out the article and post the exact solution but this may give you something to go on.

    Andy J
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    4
    Rep Power
    0
    thanks - let me know
  6. #4
  7. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Colchester, England
    Posts
    131
    Rep Power
    14
    At last I have dug the solution from MSDN:

    <META HTTP-EQUIV="REFRESH" CONTENT="1200;URL=http://MyServer/Logoff.php">

    This tag redirects the browser to Logoff.php after 20 minutes (1200 seconds) if it is not refreshed or if another page is not loaded. Keep in mind that the page is redirected automatically if it has not been refreshed. If the user has taken actions on the page that did not result in the page being refreshed, the redirection still occurs.

    Andy J
  8. #5
  9. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>At last I have dug the solution from MSDN:

    That does just redirection and doesn't close the user's browser at all.
  10. #6
  11. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Colchester, England
    Posts
    131
    Rep Power
    14
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by freebsd:
    >>At last I have dug the solution from MSDN:

    That does just redirection and doesn't close the user's browser at all.
    [/quote]

    Sorry, I forgot to say that the redirection to Logoff.php would execute a php script that would sever links, sessions, databse connections or what ever needs closing. This solution does answer Nick's question:

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by nickd:
    >>I need to close users down after a time out period.

    Thanks

    Nick
    [/quote]



    Closing the users browser isn't something most users would be very happy about. So I think a reasonable compromise would be a redirection to a logoff script.

    Andy J.


    [This message has been edited by eaamj01 (edited November 03, 2000).]
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    4
    Rep Power
    0
    I think we'll just let the session time out on the Server and so force a re-login on the client .... much eaiser .....

    but Thanks for your help

    Nick
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Location
    Denmark
    Posts
    69
    Rep Power
    18
    hmm can't you use the javascript code
    self.close() ??

    it'll promt you if you have a "normal" browser window if you really wanna close the window, but if you have poped a new window, with the
    window.open("site.htm","title","width=500,height=300");
    and on the page "site.htm" uses the self.close() it'll just close the window.

    is this about what you're looking for??

    regards
    Simon
  16. #9
  17. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    4
    Rep Power
    0
    thanks, but I need to close the users main browser with OUT asking or a prompt.

    pop-up are no problem.

    Nick

IMN logo majestic logo threadwatch logo seochat tools logo