<HTML dir=ltr><HEAD><TITLE>[rt.omnihotels.com #6423] [Comment] Micros : Phoenix : Help Matt debug cookies</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText39587 dir=ltr>
<DIV dir=ltr><FONT face="Courier New" color=#000000 size=2>Wow. Here's the first time I've seen PerlNET in the wild...</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT> </DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>This is one of our vendors using CPAN's Crypt::Tea inside ASP.NET via PerlNET since they can't find a compatible TEA (Tiny Encryption Algorithm) implementation in Widowsland. (Until now. -grin-)</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT> </DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>j</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT> </DIV>
<DIV dir=ltr><FONT face="Courier New" size=2></FONT> </DIV></DIV>
<P><FONT size=2></FONT> </P>
<P><FONT size=2><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"<BR>"<A href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</A>"><BR><html xmlns="<A href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</A>"><BR><BR><head><BR> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><BR> <title></title><BR> <style><BR> body { font-family:verdana; font-size:11px; line-height:1.5em; }<BR> </style><BR></head><BR><BR><body><BR><BR><BR><BR><%@ Page Language="perl" debug="true"%><BR><script runat="server"><BR>use namespace "System";<BR>use namespace "System.Collections";<BR>use namespace "System.ComponentModel";<BR>use namespace "System.Data";<BR>use namespace "System.Drawing";<BR>use namespace "System.Web";<BR>use namespace "System.Web.SessionState";<BR>use namespace "System.Web.UI";<BR>use namespace "System.Web.UI.WebControls";<BR>use namespace "System.Web.UI.HtmlControls";<BR>use PerlNET qw(enum AUTOCALL);<BR> use Crypt::Tea;<BR><BR>=for interface<BR> protected override void OnLoad(System.EventArgs e);<BR> str DecryptCookie(str myCookieVal);<BR>=cut<BR><BR>sub DecryptCookie<BR>{<BR> my ($myCookieVal) = @_;<BR> my $key = "*hjkqhwuihqdiuhqidqhdqkN ^)-";<BR> my $decrypted_cookieval = decrypt ($myCookieVal, $key);<BR> return $decrypted_cookieval;<BR>}<BR><BR><BR><BR> sub OnLoad {<BR> my($this, $e) = @_; <BR> my $myCookie = $this->{Request}->Cookies;<BR> my $cookieCount = $myCookie->{Count}; <BR> <BR> for ($start=0; $start<$cookieCount; $start++)<BR> { <BR> my $myCookieName = $myCookie->Get(int($start))->{Name}; <BR> my $myCookieVal = "";<BR> <BR> if($myCookieName eq 'common')<BR> {<BR> $myCookieVal = $myCookie->Get($myCookieName)->{Value}; <BR> }<BR> elsif ($myCookieName eq 'login_fg')<BR> {<BR> $myCookieVal = $myCookie->Get($myCookieName)->{Value}; <BR> $decrypt_cookieval = DecryptCookie($myCookieVal); <BR> $this->{Response}->Write("<br/><br/><strong>Encrypted login_fg<BR>cookie:</strong> ");<BR> $this->{Response}->Write($myCookieVal);<BR> $this->{Response}->Write("<br/><br/><strong>Decrypted login_fg<BR>cookie:</strong> ");<BR> $this->{Response}->Write($decrypt_cookieval); <BR> }<BR> elsif ($myCookieName eq 'Phoenix_state')<BR> { <BR> $myCookieVal = $myCookie->Get($myCookieName)->{Value};<BR> $decrypt_cookieval = DecryptCookie($myCookieVal); <BR> $this->{Response}->Write("<br/><br/><strong>Encrypted " .<BR>$myCookieName . " cookie:</strong> ");<BR> $this->{Response}->Write($myCookieVal);<BR> $this->{Response}->Write("<br/><br/><strong>Decrypted " .<BR>$myCookieName . " cookie:</strong> ");<BR> $this->{Response}->Write($decrypt_cookieval); <BR> }<BR> elsif (index($myCookieName,'Phoenix_state_room') == 0)<BR> {<BR> $myCookieVal = $myCookie->Get($myCookieName)->{Value}; <BR> $decrypt_cookieval = DecryptCookie($myCookieVal); <BR> $this->{Response}->Write("<br/><br/><strong><strong>Encrypted " .<BR>$myCookieName . " cookie:</strong> ");<BR> $this->{Response}->Write($myCookieVal);<BR> $this->{Response}->Write("<br/><br/><strong><strong>Decrypted " .<BR>$myCookieName . " cookie:</strong> ");<BR> $this->{Response}->Write($decrypt_cookieval); <BR> }<BR> <BR> <BR> }<BR> <BR> <BR> <BR> <BR> }<BR><BR><BR> # This is an autohookup method<BR><BR>=for interface<BR> void Page_PreRender();<BR>=cut<BR><BR> sub Page_PreRender {<BR> my $this = shift;<BR> <BR> }<BR><BR></script><BR></body><BR><BR></html><BR></P></FONT></BODY></HTML>