I am trying to achieve SSO between apache and IIS. I am trying to set a cookie in IIS that can be read by Apache. The following code creates and sets the cookie. Can anyone help me please to convert this code to vb.net? I would be very much thankful to you.
SudhAlam
Member
20 Points
6 Posts
Convert PHP code to ASP.NET
Jun 28, 2007 02:43 AM|LINK
$ip = explode(".",$REMOTE_ADDR); $ts = isset($arg["ts"]) ? $arg["ts"] : time(); $ts_arr = array(($ts & 0xff000000) >> 24, ($ts & 0xff0000) >> 16, ($ts & 0xff00) >> 8, ($ts & 0xff)); $ipts = pack("C8",$ip,$ts_arr); $digest0 = md5($ipts . $secret . $username . $tokens . $user_data); $digest = md5($digest0 . $secret); $tokens .= '!'; $cookie = sprintf("%s%08x%d!%s%s", $digest, $ts_arr, $username, $tokens, $data); $cookie = base64_encode($cookie); setcookie($cookiename,$cookie,0,'/'); header("Location: $returnURL");