Recommended: Are you ready to prevent script intrusion? As network administrators, many friends are also responsible for the company's website development and maintenance work. I think everyone is proficient in WEB development, but it may not be clear about how to write secure script code and how intruders penetrate the server through WEB.
1. Join at the head of Asp page
| The following is the quoted content: Response.Buffer = True Response.ExpiresAbsolute = Now() - 1 Response.Expires = 0 Response.CacheControl = no-cache Response.AddHeader Pragma, No-Cache |
2. Add to HTML code
| The following is the quoted content: <HEAD> <META HTTP-EQUIV=Pragma CONTENT=no-cache> <META HTTP-EQUIV=Cache-Control CONTENT=no-cache> <META HTTP-EQUIV=Expires CONTENT=0> </HEAD> |
3. When calling the original page again, pass a parameter Href=****.asp?random() to the page
The first two methods are said to sometimes fail, while the third is to pass a random parameter when jumping! Because aspx's cache is related to parameters, if the parameters are different, the cache will not be used, but the page will be regenerated. You can avoid using cache by passing a random parameter every time. This only works with asp&asp.net
4. You can use the following code to achieve no cache in the jsp page:
| The following is the quoted content: response.setHeader(Cache-Control,no-cache); //HTTP 1.1 response.setHeader(Pragma,no-cache); //HTTP 1.0 response.setDateHeader (Expires, 0); //prevents caching at the proxy server |
These codes are added in the middle of <head> </head> as follows
| The following is the quoted content: <head> <% response.setHeader(Cache-Control,no-cache); //HTTP 1.1 response.setHeader(Pragma,no-cache); //HTTP 1.0 response.setDateHeader (Expires, 0); //prevents caching at the proxy server %> </head> |
5. window.location.replace(WebForm1.aspx);
The parameters are the page you want to overwrite. The principle of replace is to replace the page specified by the replace parameter with the current page.
This prevents the user from clicking the back key. Using javascript scripts, as shown below:
| The following is the quoted content: a.html <html> <head> <title>a</title> <script language=javascript> function jump(){ window.location.replace(b.html); } </script> </head> <body> <a href=javascript:jump()>b</a> </body> </html> b.html <html> <head> <title>b</title> <script language=javascript> function jump(){ window.location.replace(a.html); } </script> </head> <body> <a href=javascript:jump()>a</a> </body> </html> |
The first 4 types just clear cache, that is, temporary files stored in the Temporary Internet Files folder, while the fifth type is to use jump page files to replace the current page file, and does not clear cache, which means that Temporary Internet Files produces related temporary files. Using the two together is really a must-have medicine to clear the cache. I happened to have a record here, so I come and check it out often.
Share: ASP 3.0 Advanced Programming (44) Chapter 10 ASP and Client Data Discuss client data in an ASP monograph. Is this contradictory to server-side ASP programming? This is not the case, because we have not yet met an ASP programmer who only works on server-side programming. Although ASP is a server-side technology,