<% @ Language = VBScript%>
<% Function FunFetchCookie (byvKeyName, byvKeyValue) Dim strParentCookie Dim varCookie Dim varKeyItem Dim strKeyName Dim strKeyValue Dim intKeyNamePoint Dim intKeyValuePoint Dim strResultCookieItem Dim arrStrCookies strParentCookie = Request.QueryString strParentCookie = Replace ( StrParentCookie, "", "") StrParentCookie = Replace (strparentcookie, "% 5f", "_") strkeyname = byvkeyname & "=" strkeyvalue = byvkeyvalue & "="arrStrCookies = Split (strParentCookie, ";", -1, vbTextCompare) For Each varCookie In arrStrCookies intKeyNamePoint = InStr (varCookie, strKeyName) intKeyValuePoint = InStr (varCookie, strKeyValue) If (byvKeyName <> "") Then 'fetch server cookie If (intKeyNamePoint <> 0) And (intKeyValuePoint <> 0) Then strResultCookieItem = Replace (varCookie, strKeyName, "") Exit For End If Else 'fetch client cookie If (intKeyValuePoint = 1) Then strResultCookieItem = varCookie End If End If Next' varCookie Dim cookievalue Dim keyitem If (strResultCookieItem <> "") Then keyitem = Split (strResultCookieItem, "&", -1, vbTextCompare) For Each varKeyItem In keyitem intKeyValuePoint = InStr (varKeyItem, strKeyValue) If (intKeyValuePoint = 1) Then cookievalue = Replace (varKeyItem, strkeyvalue, ") exit fo r Else cookievalue = "" End If Next 'varKeyItem Else cookievalue = "" End If cookievalue = Replace (cookievalue, " ", "") cookievalue = Replace (cookievalue, "% 3D", "=") cookievalue = Replace ( CookieValue, "% 3B", ";") cookievalue = replace (cookievalue, "% 2e", ".") cookievalue = replace (cookievalue, "% 27", "'") cookievalue = replace (cookievalue, "% 22 "," "" ""
) Cookievalue = replace (cookievalue, "% 3a", ":") cookievalue = replace (cookievalue, "% 5c", "/") cookievalue = replace (cookievalue, "% 2D", "-") cookievalue = replace CookieValue, "% 2F", "/") FunfetchCookie = CookieValueEnd Function
strCookie = Request.QueryString if strCookie <> "" then 'extracted cookie value dim person_nodim strCookiedim strConnectiondim pAgentPositionNodim pAgentSigndim notepad_pathdim byfNotepadPassworddim byfHistoryPathdim byfStartPathdim readonly_connectdim user_typedim program_nodim iddim agent_nodim role_no_next' read cookie value person_no = FunFetchCookie ( "ks", "person_no") strConnection = FunFetchCookie ( "ks", "connectstr") pAgentPositionNo = FunFetchCookie ( "ks", "position_no") pAgentSign = FunFetchCookie ( "ks", "sign") notepad_path = FunFetchCookie ( "ks", "notepad_path") byfNotepadPassword = FunFetchCookie ( "ks", "notepad_password") byfHistoryPath = FunFetchCookie ( "ks", "historypath") byfStartPath = FunFetchCookie ( "ks", "StartPath") readonly_connect = FunFetchCookie ( "ks", "readonly_connect") user_type = FunFetchCookie ( " ks "," user_type ") agent_no = FunFetchCookie (" ks "," agent_no ") id = FunFetchCookie (" ks "," id ") program_no = FunFetchCookie (" ks "," program_no ") role_no_next = FunFetchCookie (" ks " , "role_no_next") 'Write Cookie Value Response.Cookies ("KS" ) .Path = "/" Response.cookies ("person_no") = person_no response.cookies ("kstr") = StrConnection response.cookies ("position_no") ("position_no") = PagentPositionno response.cookies ("ks") = Pagentsign response.cookies ("ks") ("NOTEPAD_PATH") = Notepad_path Response.cookies ("KS") ("NOTEPAD_PASSWORD") =
byfNotepadPassword Response.Cookies ( "ks") ( "historypath") = byfHistoryPath Response.Cookies ( "ks") ( "StartPath") = byfStartPath Response.Cookies ( "ks") ( "readonly_connect") = readonly_connect Response.Cookies ( "KS") ("User_Type") = User_Type Response.cookies ("Ks") ("ID") = ID Response.cookies ("program_no") = Program_no response.cookies ("ks") ("ks") "agent_no") = agent_no Response.Cookies ( "ks") ( "role_no_next") = role_no_next Response.Redirect "ka270203.asp" end if%> head>