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.
DC517 Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved.
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");d4dennis@ins...
Star
9229 Points
1314 Posts
Re: Convert PHP code to ASP.NET
Jun 28, 2007 02:59 AM|LINK
Hi There,
Try this: http://www.asp.net/migrationassistants/php2aspnet.aspx
Hope this is help ;)
Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved.
SudhAlam
Member
20 Points
6 Posts
Re: Convert PHP code to ASP.NET
Jun 28, 2007 04:02 AM|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.
er.tushar
Member
366 Points
87 Posts
Re: Convert PHP code to ASP.NET
Aug 03, 2007 11:46 AM|LINK
What kind of help are you looking for ?
What do you want to know ? where are you facing the problem ?
Tushar
HRStop.com - A web based hosted HR Management System.
Beejak.com - A web based hosted Online Invoicing and Billing Software
mod84
Participant
797 Points
275 Posts
Re: Convert PHP code to ASP.NET
Aug 20, 2007 08:52 PM|LINK
dim myCookie as New HttpCookie("cookieName")
My .NET Free Code Library
er.tushar
Member
366 Points
87 Posts
Re: Convert PHP code to ASP.NET
Sep 25, 2007 06:40 PM|LINK
Hi,
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.
Response.SetCookie(MyCookie);
That's it. You are done. (In step 2, you can set the value you are calculating)
I hope this helps.
Regards,
Tushar
Tushar
HRStop.com - A web based hosted HR Management System.
Beejak.com - A web based hosted Online Invoicing and Billing Software
ChrisLively
Member
87 Points
23 Posts
Re: Convert PHP code to ASP.NET
Jan 02, 2008 09:13 PM|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:
http://www.15seconds.com/issue/971108.htm