Re: Error

[prev] [thread] [next] [Date index for 2005/04/26]

From: Maxim Sloyko
Subject: Re: Error
Date: 05:12 on 26 Apr 2005
This is a multi-part message in MIME format.
--------------080300080406040400080608
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Cure wrote:

>
> 	
>
> 	
>
> *error:*  	Can't call method "fetch" on an undefined value at 
> /usr/home/cwarner/www/html/test/cookie_test.html line 9.
> *context:*  	
> *...*  	
> *5:*  	use Apache::Cookie;
> *6:*  	
> *7:*  	##
> *8:*  	my $cookie = Apache::Cookie->new($r);
> *9:*  	my $cookie_id = $cookie->fetch;
>
>
>
> <-- This use to work in mod_perl1. I'm currently using mod_perl2 and 
> it doesn't work. :(
>
> Using apache-2.0.54 + mod_perl2-2.0.0r3,1
>
>
>
> Cure

use Apache::Cookie::Jar (no need to "use" it in perlish way though, only 
Apache::Cookie) as this


    my $j = Apache::Cookie::Jar->new($r);
    my $id = $j->cookie("SESSION_ID")->value;

Hope this helps.

--
Maxim Sloyko


--------------080300080406040400080608
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Cure wrote:
<blockquote cite="mid426D6D37.7000109@xxxxxxxx.xxx" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
  <table border="0" cellpadding="1" cellspacing="0" height="50"
 width="1">
    <tbody>
      <tr>
        <td align="left" nowrap="nowrap" valign="top"><br>
        </td>
        <td align="left" valign="top"><br>
        </td>
      </tr>
      <tr>
        <td align="left" nowrap="nowrap" valign="top"><br>
        </td>
        <td align="left" nowrap="nowrap" valign="top"><br>
        </td>
      </tr>
    </tbody>
  </table>
  <table border="0" cellpadding="1" cellspacing="0">
    <tbody>
      <tr>
        <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>error:</b>&nbsp;</font></td>
        <td align="left" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2">Can't call
method "fetch" on an undefined value at
/usr/home/cwarner/www/html/test/cookie_test.html line 9.<br>
        </font></td>
      </tr>
      <tr>
        <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>context:</b>&nbsp;</font></td>
        <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2">
        <table border="0" cellpadding="0" cellspacing="0">
          <tbody>
            <tr>
              <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>...</b>&nbsp;</font></td>
              <td align="left" nowrap="nowrap" valign="top"><br>
              </td>
            </tr>
            <tr>
              <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>5:</b>&nbsp;</font></td>
              <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2">use
Apache::Cookie;</font></td>
            </tr>
            <tr>
              <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>6:</b>&nbsp;</font></td>
              <td align="left" nowrap="nowrap" valign="top"><br>
              </td>
            </tr>
            <tr>
              <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>7:</b>&nbsp;</font></td>
              <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2">##</font></td>
            </tr>
            <tr>
              <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>8:</b>&nbsp;</font></td>
              <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2">my $cookie =
Apache::Cookie-&gt;new($r);</font></td>
            </tr>
            <tr>
              <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>9:</b>&nbsp;</font></td>
              <td align="left" nowrap="nowrap" valign="top"><font
 face="Verdana, Arial, Helvetica, sans-serif" size="-2"><font
 color="red">my $cookie_id = $cookie-&gt;fetch;</font></font></td>
            </tr>
          </tbody>
        </table>
        </font></td>
      </tr>
    </tbody>
  </table>
  <br>
  <br>
&lt;-- This use to work in mod_perl1. I'm currently using mod_perl2 and
it doesn't work. :(<br>
  <br>
Using apache-2.0.54 + mod_perl2-2.0.0r3,1<br>
  <br>
  <br>
  <br>
Cure<br>
</blockquote>
use Apache::Cookie::Jar (no need to "use" it in perlish way though,
only Apache::Cookie) as this<br>
<br>
<br>
&nbsp;&nbsp;&nbsp; my $j = Apache::Cookie::Jar-&gt;new($r);<br>
&nbsp;&nbsp;&nbsp; my $id = $j-&gt;cookie("SESSION_ID")-&gt;value;<br>
<br>
Hope this helps.<br>
<br>
--<br>
Maxim Sloyko<br>
<br>
</body>
</html>

--------------080300080406040400080608--

Error
Cure 22:20 on 25 Apr 2005

Re: Error
Maxim Sloyko 05:12 on 26 Apr 2005

Generated at 09:30 on 27 Apr 2005 by mariachi v0.52