<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Thanks for responding, David.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>I am using JanRain!</DIV><DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Below you can see how I am setting the cookie, and it's content to be the id number of the session. So, the id of the session in the database is the cookie's value. I keep getting the error, "token not found in session," but I am passing the cookie, and the entire URL. I can see in my database, however, that there is a problem. Namely, during the first half of the operation, I get a full entry in the sessions table. I have the token key in there, type_uri, everything. But on the second part, when a second entry gets made in the session table, I have both an entirely new id, of course, because that's the primary key, but I have none of the other fields, especially no token field. </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Here is how I constructed my consumer.</DIV><DIV>__________</DIV><DIV><%init></DIV><DIV>use strict;</DIV><DIV>use warnings;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>use DBI;</DIV><DIV>use CGI;</DIV><DIV>use CGI::Session;</DIV><DIV>use Secret;</DIV><DIV>use Secret qw($name);</DIV><DIV>use Secret qw($pass);</DIV><DIV>use URI;</DIV><DIV>use URI::Query;</DIV><DIV>use URI::Escape;</DIV><DIV>use URI::QueryParam;</DIV><DIV>use Net::OpenID::JanRain::Consumer;</DIV><DIV>use Net::OpenID::JanRain::Stores::MySQLStore;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>my $dbh = DBI->connect( "dbi:mysql:openid", $name, $pass ) || die $DBI::errstr;</DIV><DIV>my $cgi = new CGI;</DIV><DIV>my $session = CGI::Session->new( "driver:MySQL", $cgi, { Handle => $dbh } );</DIV><DIV>my $cookie = $cgi->cookie( CGISESSID => $session->id );</DIV><DIV>my $store = Net::OpenID::JanRain::Stores::MySQLStore->new($dbh);</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>my $consumer = Net::OpenID::JanRain::Consumer->new( $session, $store );</DIV><DIV>my $complete;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>if ($openid_url) {</DIV><DIV> my $request = $consumer->begin($openid_url);</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV> if ( $request->status eq 'failure' ) {</DIV><DIV> my $redirect5 = "/users/login_failed_all.html";</DIV><DIV> $m->comp( "/generic/action/redirect.ml", url => $redirect5 );</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN> }</DIV><DIV> elsif ( $request->status eq 'success' || 'in_progress' ) {</DIV><DIV> my $trust_root = "<A href="http://72.52.195.139/users">http://72.52.195.139/users</A>";</DIV><DIV> my $return_to = "<A href="http://72.52.195.139/users/openid.html">http://72.52.195.139/users/openid.html</A>";</DIV><DIV> $request->addExtensionArg( "sreg", "optional",</DIV><DIV>"nickname,email,fullname,dob,gender,postcode,country,language,timezone"</DIV><DIV> );</DIV><DIV> my $redirect = $request->redirectURL( $trust_root, $return_to );</DIV><DIV> $m->comp( "/generic/action/redirect.ml", url => $redirect, cookie => $cookie );</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN> }</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>}</DIV><DIV>elsif ( $ARGS{'openid.mode'} ) {</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>my $query = URI::Query->new( $ENV{QUERY_STRING} );</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>my %query = $query->hash;</DIV><DIV><SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>$complete = $consumer->complete( \%query );</DIV><DIV> </DIV><DIV> if ( $complete->status eq 'success' ) {</DIV><DIV> my $redirect1 = "/users/login_done.html";</DIV><DIV> $m->comp( "/generic/action/redirect.ml", url => $redirect1 );</DIV><DIV> <SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>}</DIV><DIV> elsif ( $complete->status eq 'failure' ) {</DIV><DIV> my $redirect2 = "/users/completemessage.html";</DIV><DIV> $m->comp( "/users/completemessage.html", complete => $complete->message, cookie => $cookie );</DIV><DIV> <SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>}</DIV><DIV> elsif ( $complete->status eq 'cancel' ) {</DIV><DIV> my $redirect3 = "/users/login_canceled.html";</DIV><DIV> $m->comp( "/generic/action/redirect.ml", url => $redirect3 );</DIV><DIV> <SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>}</DIV><DIV> else {</DIV><DIV> my $redirect4 = "/users/login_failed_some.html";</DIV><DIV> $m->comp( "/generic/action/redirect.ml", url => $redirect4 );</DIV><DIV> <SPAN class="Apple-tab-span" style="white-space:pre">        </SPAN>}</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>}</DIV><DIV></%init></DIV><DIV>__________</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Here is a pair of sample table entries:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>| 93397c18efbc3cb8d3e0e2ccf3610544 | $D = {'_SESSION_ID' => '93397c18efbc3cb8d3e0e2ccf3610544','_SESSION_ATIME' => 1180492307,'_openid_consumer_endpoints' => [bless( {'identity_url' => bless( do{\(my $o = 'http://***.myopenid.com/')}, 'URI::http' ),'server_url' => '<A href="http://www.myopenid.com/server','delegate'">http://www.myopenid.com/server','delegate'</A> => bless( do{\(my $o = 'http://***.myopenid.com/')}, 'XML::XPath::Literal' ),'type_uris' => ['<A href="http://openid.net/signon/1.0','http://openid.net/sreg/1.0']}">http://openid.net/signon/1.0','http://openid.net/sreg/1.0']}</A>, 'Net::OpenID::JanRain::Consumer::ServiceEndpoint' )],'_openid_consumer_token' => 'y4VqBfJiDE58NiOD5qZUcpnRIfoxMTgwNDkyMzA3AGh0dHA6Ly9hbWlyaWJhcmtzZGFsZS5teW9wZW5pZC5jb20vAGh0dHA6Ly9hbWlyaWJhcmtzZGFsZS5teW9wZW5pZC5jb20vAGh0dHA6Ly93d3cubXlvcGVuaWQuY29tL3NlcnZlcg==','_SESSION_REMOTE_ADDR' => '***.***.***.***','_SESSION_CTIME' => 1180492307};;$D | </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>| fb7418d1dea9c95a6d5ca5afa41674c7 | $D = {'_SESSION_ID' => 'fb7418d1dea9c95a6d5ca5afa41674c7','_SESSION_ATIME' => 1180492319,'_SESSION_REMOTE_ADDR' => '***.***.***.***','_SESSION_CTIME' => 1180492319};;$D</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The disparity is glaring, and I can't figure out what I'm not passing through.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Amiri</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><DIV><DIV>On May 29, 2007, at 7:27 PM, Recordon, David wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"> <DIV dir="ltr" align="left"><SPAN class="046322523-29052007"><FONT face="Arial" color="#0000ff" size="2">Hi Amiri,</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="046322523-29052007"><FONT face="Arial" color="#0000ff" size="2">What OpenID library for Perl are you using?</FONT></SPAN></DIV> <DIV dir="ltr" align="left"><SPAN class="046322523-29052007"><FONT face="Arial" color="#0000ff" size="2"></FONT></SPAN> </DIV> <DIV dir="ltr" align="left"><SPAN class="046322523-29052007"><FONT face="Arial" color="#0000ff" size="2">--David</FONT></SPAN></DIV><BR> <DIV class="OutlookMessageHeader" lang="en-us" dir="ltr" align="left"> <HR tabindex="-1"> <FONT face="Tahoma" size="2"><B>From:</B> general-bounces@openid.net [<A href="mailto:general-bounces@openid.net">mailto:general-bounces@openid.net</A>] <B>On Behalf Of </B>Amiri Barksdale<BR><B>Sent:</B> Tuesday, May 29, 2007 5:18 AM<BR><B>To:</B> <A href="mailto:general@openid.net">general@openid.net</A><BR><B>Subject:</B> [OpenID] Complete method in Perl?<BR></FONT><BR></DIV> <DIV></DIV>I am having a dickens of a time finishing an openid login. I am building a consumer in perl, and I am wondering if anyone knows why this may not be working? I know I have a valid login, but I still get a failure response. Here is the code for the completion:<BR><BR> my $query = URI::Query->new( $ENV{QUERY_STRING} );<BR> my %query = $query->hash;<BR> ...<BR> my $complete = $consumer->complete( \%query );<BR><BR><BR>Here is what the IdP responds with before I try the above completion:<BR><BR>openid.sreg.gender: * <BR>openid.response_nonce: 2007-05-29T12:13:15Z8mrI9U <BR>openid.mode: id_res <BR>openid.sreg.email: ***@***.*** <BR>openid.sreg.dob: ****-**-** <BR>openid.assoc_handle: {HMAC-SHA1}{4656da94}{mZCWxg==} <BR>openid.sreg.timezone: America/*** <BR>openid.op_endpoint: <A href="http://www.myopenid.com/server">http://www.myopenid.com/server</A> <BR>openid.sreg.nickname: *** <BR>openid.sreg.postcode: ***** <BR>openid.sreg.fullname: *** <BR>openid.signed: assoc_handle,identity,mode,op_endpoint,response_nonce,return_to,signed,sreg.country,sreg.dob,sreg.email,sreg.fullname,sreg.gender,sreg.language,sreg.nickname,sreg.postcode,sreg.timezone <BR>openid.sig: MkrfIgxaxRkFMo+CJI1amtpSLBY= <BR>openid.identity: http://***.myopenid.com/ <BR>nonce: hvZi4DXd <BR>openid.sreg.language: EN <BR>openid.return_to: http://***.***.***.***/users/openid.html?nonce=hvZi4DXd <BR>openid.sreg.country: US <BR><BR><BR><BR>Amiri<BR></BLOCKQUOTE></DIV><BR></DIV></DIV></BODY></HTML>