Last post Jan 02, 2008 09:13 PM by ChrisLively
Jun 28, 2007 02:43 AM|SudhAlam|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);
Jun 28, 2007 02:59 AM|d4dennis@inspir3|LINK
Try this: http://www.asp.net/migrationassistants/php2aspnet.aspx
Hope this is help ;)
Jun 28, 2007 04:02 AM|SudhAlam|LINK
Thanks for the information. I tried that but didnt work. Thats why looking for some help from people who knows both php and asp.net.
Aug 03, 2007 11:46 AM|er.tushar|LINK
What kind of help are you looking for ?
What do you want to know ? where are you facing the problem ?
Aug 20, 2007 08:52 PM|mod84|LINK
dim myCookie as New HttpCookie("cookieName")
Sep 25, 2007 06:40 PM|er.tushar|LINK
Setting a cookie in asp.net is a 3 step process. (I'll be writing code in C#, which you can convert in VB.NET easily)
1. Create cookie.
HttpCookie MyCookie = new HttpCookie("CookieName"); //C#
Dim MyCookie as New HttpCookie("CookieName") 'VB
2. Calculate and set the value of cookie
MyCookie.Value = "CookieValue";
3. Set the cookie in the response object so that it can be set in the browser.
That's it. You are done. (In step 2, you can set the value you are calculating)
I hope this helps.
Jan 02, 2008 09:13 PM|ChrisLively|LINK
I would add just a couple of things.
First, the cookie can only be read by the originating domain. That said, cookies can be shared between sub domains. See the following: