|
Posted by pangea33 on 12/20/06 07:47
powellgg@masters.edu wrote:
> I've just taken over a PHP website and am converting it to ASP.NET
> (don't shoot!). I'm not a PHP guy so I'm doing a lot of searching for
> things that I aren't obvious, and I'm hoping I'll be able to get help
> from here for things I can't find on the Internet. Here's the first...
>
> Here's the PHP code:
>
> setcookie("site_search_keyword","", time() - 3600);
> $site_search_keyword =
> unserialize(base64_decode($site_search_keyword));
>
> Microsoft's PHP to ASP.NET convert translated it to this:
>
> PHP.HttpSupport.SetCookie("site_search_keyword", "",
> PHP.DateTimeSupport.Time() - 3600);
> site_search_keyword =
> PHP.TypeSupport.ToString(unserialize(base64_decode(site_search_keyword)));
>
>
> .Net has no corresponding method for unserialize() and I can't find
> where the page/site does the initial serialization. Is there an
> underlying serialization when it is creating the cookie? If the first
> line is setting a null value to the cookie, why would the second line
> try to read it? It's going to be the same every time... right?
There is equivalent functionality available in .NET. Googled it...
http://www.411asp.net/func/search?tree=411asp%2Ftutorial%2Fspecific%2Fweb%2Fuserinte%2Fstatebag&qry=base64&cat=all&x=0&y=0
http://www.google.com/search?q=base64+asp.net&hl=en&lr=&start=10&sa=N
Navigation:
[Reply to this message]
|