By Rich W.
I am building an intranet site that has different levels of security, and a current problem with the legacy software is that people spend time finding out information that they aren't supposed to have access to. The login security can be a problem if the session timeout is too long, but even then users can come by and see someone's computer screen if they don't close the browser window. I found a fix that automatically asks the users for the login and password if they just leave the browser open. In my include file that contains my login check, (this appears at the top of every asp page that requires the login security.) I added one line. Here is the file contents:
Response.AddHeader "Refresh",CStr(CInt(Session.Timeout + 1) * 60)
Response.AddHeader "cache-control", "private"
Response.AddHeader "Pragma","No-Cache"
Response.Buffer = TRUE
Response.Expires = 0
Response.ExpiresAbsolute = 0
If (Session("Authenticated") <> Session.SessionID) Then
Session("RequestedURL") = "http://" & _
Request.ServerVariables("SERVER_NAME") & _
Request.ServerVariables("SCRIPT_NAME")
Temp = Request.ServerVariables("QUERY_STRING")
If (Not(ISNull(Temp)) AND Temp <> "") Then
Session("RequestedURL") = Session("RequestedURL") & _
"?" & Temp
End If
Response.Redirect("/login.asp")
End If
|
Line 1 addes a refresh tag that refreshes the page exactly 1 minute after the session timed out. This will cause the login page to appear and then redirect the user back to the page they were viewing.
Hope this helps someone,
Happy Programming!
分享到:
相关推荐
A tool's output is written to the Output window, and the user can copy and clear text from this window. Moreover, the output from the tool is displayed as it is being written, instead of all at once ...
The 80x86 MOV Instruction 4.8 - Some Final Comments on the MOV Instructions <br>4.9 Laboratory Exercises 4.9.1 The UCR Standard Library for 80x86 Assembly Language Programmers 4.9.2 ...
15.1.4 Terminating the LIB Session 15.2 Performing Library-Management Tasks with LIB 15.2.1 Creating a Library File 15.2.2 Changing a Library File 15.2.3 Adding Library Modules 15.2.4 Deleting Library...
*Change: Improved user experience: the control will now display instantly when it s dropped on the Web form, no need to first select the Button Type in the Property window. *Change: DLL name ...
Redirecting Standard Output to a CEdit Control (27KB)
By doing this, the parameters can be modified, the original program can be tricked if you choose to return an error code when really it should be successful, and so on. All of this is done before the...
Redirecting the mouse and keyboard is as simple as moving the mouse off the edge of your screen Synergy also merges the clipboards of all the systems into one allowing cut and paste between systems ...
<br> Fixed Bugs: <br> HTTP Client - problems with changing the request method from POST to GET when redirecting to another location were fixed. Http Client - the ReceiveProgress ...
It is strongly recommended that if you are redirecting to another action, you use this result rather than the standard redirect result. See examples below for an example of how request parameters ...
Collecting the reflected light and redirecting it onto skin surfaces will increase the effective input energy, resulting in an increase of light penetration depth for the same light source....
The C++ Standard Library A Tutorial and Reference (2nd Edition)+cppstdlib-code.zip C++标准库(第二版)英文版.pdf 非扫描版+源代码 Prefaceto the SecondEdition xxiii Acknowledgments for the Second...
7.5.1. Redirecting with URL templates 7.5.2. Working with flash attributes 7.6. Summary Chapter 8. Working with Spring Web Flow 8.1. Configuring Web Flow in Spring 8.1.1. Wiring a flow executor 8.1.2....
Bad request 错误请求 403 - Forbidden 禁止 500 - Internal Server Error 内部服务器错误 404 - Wrong page 找不到页面 Then, all you need to do is to create a file to display when the error ...
Redirecting requests 114 Location 115 Implementing resource caching 116Table of Contents [ iv ] Handling file uploads 118 Putting it all together 120 Summary 121 Chapter 5: Managing Many Simultaneous ...
in converts the text format (DOS or UNIX) of a file when it is saved in Visual Studio.(39KB)<END><br>78,devtruecolour.zip Use any colour in the Developer Studio IDE(49KB)<END><br>79,openvc_demo.zip...
Managing authors and users with the User Manager 12 Getting ready 12 How to do it 13 Deleting users 13 Editing user details 13 How it works 14 Importing and exporting content with the Import and...
Handling the "User Pressed Stop Button" Case Section 6.10. Handling Server Timeout Cases and Working with $SIG{ALRM} Section 6.11. Generating Correct ...
The Implementation of the Book Using the Code from This Book Audience Organization Further Reading Conventions Used in This Book How to Contact Us Safari® Enabled Acknowledgments ...
/home/rootroot/sogou/toolchain/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp] #warning redirecting incorrect #include <sys/poll.h> to ^ In...
User Groups. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538 MySQL Resources. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538 Apache ...