Security risks and Countermeasures of ASP + Access (continued)

Source: Internet
Author: User


To prevent unregistered users from directly accessing the application system through the registration interface, you can use the Session object for registration verification. The biggest advantage of a Session object is that it can retain the information of a user so that subsequent web pages can be read. For example, design the registration page shown in 1.

After the user registration is successful, the system starts hrmis. asp? Page = 1 page. If the Session object is not used for registration verification, the user clicks "URL/hrmis. asp?" in the browser? Page = 1 "to bypass the registration interface and directly access the system. The Session object can effectively prevent this situation. The related program code is as follows:

 

<% Read the account and password entered by the user
UserID = Request ("UserID ")
Password = Request ("Password ")
Check whether UserID and Password are correct (the actual program may be complicated)
If UserID <> "hrmis" Or Password <>
"Password" Then
Response. Write "Account Error !"
Response. End
End If
Set the Session object to the verified status
Session ("Passed") = True
%>

After entering the application, first verify:

<% If the verification fails, the Login status is returned.
If Not Session ("Passed") Then
Response. Redirect logs login.htm"
End If
%>
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.