| Thành viên | Trả lời |
haibanh

15 bài
| 24-3-2009 23:51:29 Mục tiêu :
Khi đăng nhập với tại web samplecom thì tiếp theo nó phải ok với site subsamplecom
Khi đăng nhập hệ thống, các thông số username của chúng ta sẽ được encrypt (mã hóa)
trong web config chúng ta dùng cái này
---------- <authentication mode="Forms"> <forms name="EXAMPE-ATH" loginrl="oginaspx" protection="All" timeout="30" path="" > <authentication>
Nếu 2 cái web trên 2 máy thì sửa thêm cái này
<machineKey validationKey="BD52058A3DEA473EA99F29418689528A494DF2B00054BB7C" decryptionKey="684FC9301F404DE1B9565E7D952005579E823307BED44885" >
2 giá trị này được mã hóa bởi thuật toán (DES) or 48 (TripleDES) ký tự long hexadecimal
Signing on Dim C As SystemWebHttpCookie = _ SystemWebSecurityFormsAuthenticationGetAuthCookie(serName, False) CDomain = "examplecom" esponseAppendCookie(C) esponseedirect(SystemWebSecurityFormsAuthenticationGetedirectrl(serName, False))
Sign off Dim C As SystemWebHttpCookie = _ equestCookies(SystemWebSecurityFormsAuthenticationFormsCookieName) CDomain = "examplecom" CExpires = DateTimeNowAddDays(-1) esponseCookiesAdd(C)
|
 |