Global.asa Logout On Browser Close
I wrote global.asa file but I couldn't get what I expect.After user logs on to the system,if he/she directly closes the explorer,the time he/she logs out must be written to the database.I have logout.asp file which do this when the user click on the LOGOUT button,but if the user doesn't click it just closes the explorer what handles it??The following global.asa tries to do that but I think there is something wrong.If you examine it I would be very happy thanks...
GLOBAL.ASA
<script language=vbscript runat=server>
Sub Application_OnEnd()
session.abandon()
End Sub
Session.Timeout=1
Sub Application_OnStart()
Application("CurrentUser")=0
Application("TotalUser")=0
End Sub
Sub Session_OnEnd()
Application("CurrentUser")=Application("CurrentUser")-1
Application("TotalUser")=Application("TotalUser")-1
Set con = Server.CreateObject("ADODB.Connection")
con.Open "DSN=Address"
SQL="UPDATE tblLog SET fldTimeOut= "' & Time() & "' WHERE fldUserName= "' & Session("Admin") & "'"
con.execute(SQL)
session.abandon()
con.close
End Sub
Sub Session_OnStart()
Application("CurrentUser")=Application("CurrentUser")+1
Application("TotalUser")=Application("TotalUser")+1
End Sub
</script>
View Replies
ADVERTISEMENT
When I user decisedes to leave my site.How can I detect that imidietly and trigger code to run from that?
View Replies
View Related
What's the best way to close current window silently after finished a
process.
I'm using the the javascritpt window.close() or top.window.close(), but it
fires a confirmation window.
Just want to close it without any confirmation, seems I done it before, but
can't find where.
View Replies
View Related
I wrote an ASP page to export data from the database to an excel spreadsheet file. The problem is, after the user saved the file to his/her hard drive, the export browser window still remains. How do I close the export window after users saved the file?
View Replies
View Related
which event is fired when a browser is closed. i want to call asp page which deleet some files on the server. i tired using onunload event but it aslo get fired when a page is refreshed. the thing should work in netsacpe also.
View Replies
View Related
I have a wierd question that may involve a little explaining. I have a web app that uses SOAP calls to manipulate the files in a source safe database, and i need to program for the possibility that someone will close the browser before they check a file back into the source safe.
i need to execute a "ReleaseFile" soap call so that the file will be not be checked out, to remove the ability for other users to edit the file So far i have tried putting my final soap call in my Global.asa and then set the timeout variable to 1, the global is executing, but the SOAP doesn't always execute, and the session is left hanging, or the file isn't checked.
View Replies
View Related
I've been trying to save some user settings when the browser closes, but with little success. What I want to do is count a users' resource usage, and write it to a database when the user closes the browser. I tried to use the 'Session_End' event handler in global.asax, but that doesn't seem to work.
View Replies
View Related
I use Request.ClientCertificate to read user cert from Estonian National ID
Card for authenticating users. All works fine, i can read cert and personal id code, authent. user aso.
But problem is when user logs out and the browser info stays open, even when
user removes id-card from reader and clicks on "Login" link, user will be authenticated because cert. is in cache? Code:
View Replies
View Related
I have one application folder containing all ASP code files. I want host multiple sites pointing to same code. Can I do this ? If YES then how I can assign diffrent global.asa to each application...
View Replies
View Related
I have added a db driven marquee to my site and need to combine the global asa's to 1 global asa file. Code: ......
View Replies
View Related
everytime a user logs out from the protected pages he doesnt really logs out
cuz when he hits the "back" button he can access the pages again.
i tried session.abandon(), but and response.addheader.....
i practically used everything and it didnt work...
View Replies
View Related
when i click log out that you can not return in previous page how can i do that.
i have a code logout but when i click going to redirect to page( login.asp) thats right but when you click the back button he return to admin_control.asp
how can i avoid that.
When click log out that can not return to previous page how how
View Replies
View Related
I got the logout code correctly however because my main menu page is divided up into 3 frames, left is content and that's where my logout link will be. When I click logout the login.asp is displayed but on the left frame. How do I get the page to delete the frame. Do I do it in logout.asp
<%@ Language = "VbScript" %>
<%
if request.querystring("cmd") = "logout" then
session("StudentNo") = 0
Response.Redirect("login.asp")
End If
%>
View Replies
View Related
Is there someway to prevent users from using the "go back one page" function to go back to the previous page after they are logged out
View Replies
View Related
i have a logout link when the user click the logout button. the login page loads but when i click the back button i still have those pages i have acessed before help on how to solve this problem/remedies ?
View Replies
View Related
I have 3 frames in my page. When i log out i would like to replace my framed page with another page. I tried using the link below but nothing happens. Code:
View Replies
View Related
I have a button that would allow a user to logout of the program, how can this be done? Also, how can I allow the program to logout and terminate if not used after so many minutes?
View Replies
View Related
I am facing a strange problem, let me explain the problem and list two different platform i found on some of the client pcs. Problem :-
First time login in to my application page is ok, but if click logout, it wouldnt bring back to login page, it just stay as it is. But if you click on one of the link, it push back to login page.
So for second time to login, no matter how many time you try, it would not able to login.
And i found out if i clear those IE's cookies and offline file, i can login again.
Clients
1) Window2000, IE 6
2) WindowXP, IE 6
And there is only happen certain user's pc, some others user even with same spec have no problem. And I found out if i login into window using different domain user, it does'nt have problem. Is it something to do with user profile of IE setting
View Replies
View Related
I am using a tracking where the S/W shows the status whether the user has logged in or not. I am able to do the same if the user logs out using the proper link. If the user closes the window instead of logging out using the proper link, i am not able to capture the logout time. I tried the window onunload event, (the page contains frames) it does not work. Can anybody show me a way out?
View Replies
View Related
How would i code a logout function?
View Replies
View Related
I have created a web site, where the user can login and logout.
when the user logouts, he should not be allowed back into the site until he logins in again. but in my case when the user logouts, and then press the "Back" button of the browser he is back in the site. Can someone please help me with this
Also how can I restrict the same user logining in twice with the same username and password.
View Replies
View Related
I was wondering if there's a piece of code that will do the following:- When the user closes the database, I want to pass the current date and time into a field in the database!
View Replies
View Related
i am using frams in asp. My problem is,when i click the logout button new window is opened. while i want not to appear new window but login page should be replaced with existing window.
View Replies
View Related
I want to have a logout page that gives members the option to logout.
Is it just a case of doing a simple session.end, or how do I go about it
View Replies
View Related
How to logout from the application using ASP , session object.Can u explain the use of Global.asa file & Once i logded out , if i clik Back button in browser, it shuldnt allow to view the authorised page.
View Replies
View Related
how to do the do the feature which after the user logout, they are not able to view the page again when they hit the back button.
View Replies
View Related
i need a simple ASP code for creating page with login and logout function.anyone can help me?
View Replies
View Related
I have a gaming web site and I would like to have a login and logout which they have to register for. I using a asp host and I'm using ms access for my database.
View Replies
View Related
I am using Session.Abandon on my logout script and works fine I show the you have been succesfully logged out of the system message. my problem is if the user clicks on back he can still see the last page with important info, maybe by the previous user. This doesn't happen for example when you log out form Yahoo mail and others.
View Replies
View Related
I am currently using a script to logout which contains this code only...
<%
Session.Abandon ()
Response.Redirect ("main.asp")
%>
Please could you tell me if there is a way to actually delete the session from the users browser history? The above code works ok, as long as the browser is closed first, deleting the cookie info.
View Replies
View Related
How do I log out a user? I tried to use the following code called from a "Log Out" button.
<%
' Logout of Restricted Section
Session("blnIsUserGood") = False
'Redirect to the home page
Response.Redirect"http://www...org/"
%>
This does set the session variable correctly but if I hit the "Back Button" on my browser I get the page that I last accessed. If I try to navigate from there I am redirected to the log-in page (that is good). So how do I prevent the back button viewing of the last page?
View Replies
View Related
i am having problems with a logout code that i wrote for my site.. when the person logsout, i abandon the session, and so all session variables are set to nothing. now when somebody hits the browser's back button and then the refresh button, message to retry sending information back to the server appears, if i click on retry button, the page is resubmitted and the user logs in again.
View Replies
View Related
I want to implement a 15 minute time lag between logout and login of a new account. If the user sharing the same PC with his friends to log on to my site, he need to wait for 15 minutes after logging out before logging in a new account.
So once a user leaves my site or logs out and wants to login to my site with different username he has to wait for 15 minutes before he can log on again with different username.
View Replies
View Related