Re: [vox-tech] when is an html image sent?

2005-12-17 Thread Rod Roark
On Friday 16 December 2005 11:24 pm, Peter Jay Salzman wrote:
 ... No matter what I try, though, I
 can't access sessions from the captcha2.php file.  I guess it must interfere
 with the image being sent to the client.

Oooh.  It must be that there's no mechanism for the browser to send
the cookie (which contains the session ID) when it requests an
image.  Sorry I caused you so much trouble.

I think what may work is to send the session ID in the URL.  That is,
construct the image URL like this:

  $url = 'captcha2.php?' . session_name() . '=' . session_id();

and then your form requests the image with:

  img src='?php echo $url ?'

or whatever the equivalent is with Smarty.

I have not tried this, it's just my best guess from reading the docs.

-- Rod
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] when is an html image sent?

2005-12-17 Thread Peter Jay Salzman
On Sat 17 Dec 05, 12:15 AM, Rod Roark [EMAIL PROTECTED] said:
 On Friday 16 December 2005 11:24 pm, Peter Jay Salzman wrote:
  ... No matter what I try, though, I
  can't access sessions from the captcha2.php file.  I guess it must interfere
  with the image being sent to the client.
 
 Oooh.  It must be that there's no mechanism for the browser to send
 the cookie (which contains the session ID) when it requests an
 image.  Sorry I caused you so much trouble.
 
 I think what may work is to send the session ID in the URL.  That is,
 construct the image URL like this:
 
   $url = 'captcha2.php?' . session_name() . '=' . session_id();
 
 and then your form requests the image with:
 
   img src='?php echo $url ?'
 
 or whatever the equivalent is with Smarty.
 
 I have not tried this, it's just my best guess from reading the docs.
 
Thanks Rod!

Unfortunately, it's still not working.  Here's what I tried:


Smarty template/web page view_by_permalink.php:

   $smarty-assign('sessionId', session_id());
   $smarty-assign('sessionName', session_name());

   img src=captcha2.php?{$sessionName}={$sessionId} alt=validation string 
/

captcha2.php:

   session_id( $_REQUEST['PHPSESSID'] );
   start_session();
   $_SESSION['captcha'] = $cmntPass;



Using error_log(), I determined that in captcha2.php, $_REQUEST['PHPSESSID']
is the correct session ID.  But something isn't right because if I stick

   error_log('hello world');

in captcha2.php before start_session(), the message appears in my error log.
But if I stick it in after start_session(), it doesn't appear.  So PHP seems
to be very unhappy with the start_session() line.

Needless to say, 'captcha' is an undefined $_SESSION index in the receiving
form.

I'm really on ground here.  I'm reading, but there's enough documentation to
drown in.

Have any idea on how to proceed?

Pete
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] when is an html image sent?

2005-12-17 Thread Ted Deppner
On Sat, Dec 17, 2005 at 10:16:07AM -0500, Peter Jay Salzman wrote:
 Have any idea on how to proceed?

Have your image.php script dump the environment to a file you can review.
You should see a number of interesting things in there, like the source ip
address and port, browser version, etc, etc.

If you md5sum some of that stuff together, you'll get a key, which you
could then store related to that session, and use from the image to find
that session.  Probably.  Depending on what you use that may not be
foolproof -- so think about it.  Aol has proxies that might hide a bunch
of people, and so forth.

-- 
Ted Deppner
http://www.deppner.us/
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] when is an html image sent?

2005-12-17 Thread Rod Roark
On Saturday 17 December 2005 07:16 am, Peter Jay Salzman wrote:
...
 captcha2.php:
 
session_id( $_REQUEST['PHPSESSID'] );

Try it without explicitly setting the session ID here.  PHP is
supposed to parse the session ID from the URL transparently.  If
you set it with session_id(...) then a new cookie will be sent,
and that may not be valid when returning an image.

Also make sure session.use_only_cookies is not set in your php.ini.

I'll cross my fingers for you.  ;-)

-- Rod
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] when is an html image sent?

2005-12-17 Thread Rod Roark
OK I couldn't stand it and did a test.

test1.php:

  ?php
session_start();

if (!isset($_SESSION['count']))
   $_SESSION['count'] = 0;
else
   $_SESSION['count']++;

echo Count is  . $_SESSION['count'] . br;
echo img src='test2.php';
  ?

test2.php:

  ?php
header(Content-type: image/png);

session_start();

if (!isset($_SESSION['count']))
   $_SESSION['count'] = 0;
else
   $_SESSION['count']++;

$im = @imagecreate(100, 50);
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  Testing, $text_color);
imagepng($im);
imagedestroy($im);
  ?

Everything seems to work, even with just cookies.  The count
increments by 2 on each refresh, and the image is displayed.

-- Rod
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] gpg-agent issues

2005-12-17 Thread Micah J. Cowan
On Fri, Dec 16, 2005 at 10:02:00AM -0800, Richard Crawford wrote:
 I'm trying to get gpg-agent running on my FC3 laptop so that I don't have to 
 type in my passphrase each time I send out an e-mail.  Unfortunately, when I 
 try to start gpg-agent with the command:
 
 $ gpg-agent
 
 I get the following error message:
 
 gpg-agent: can't connect to '/home/richard/.gnupg/S.gpg-agent': No such file 
 or directory
 gpg-agent: no gpg-agent running in this session

snip

 When, for kicks and giggles, I try to execute:
 
 $ gpg-agent --daemon
 
 I get this error message:
 
 can't connect to '/home/richard/.gnupg/log-socket': No such file or directory
 GPG_AGENT_INFO=/tmp/gpg-4p6U8v/S.gpg-agent:10175:1 export GPG_AGENT_INFO;
 
 ...even though there is a file in /home/richard/.gnupg called log-socket.  
 However, that file appears to be empty.  Also, when I again execute

The error message above looks very fishy indeed: it looks like it's
attempting to read in that entire line, starting with GPG_AGENT_INFO and
ending with the export command, as the /name/ of a file. Try to find out
what is doing that (a miswritten config file somewhere?)

You can use the fuser or lsof commands to find all the processes that
have a given file open: that could come in handy; as could examining the
/proc/pid directory of gpg-agent (run with --daemon), and examining
what files it has open.

HTH,
Micah
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] when is an html image sent?

2005-12-17 Thread Peter Jay Salzman
On Sat 17 Dec 05,  9:59 AM, Rod Roark [EMAIL PROTECTED] said:
 OK I couldn't stand it and did a test.
 
Rod, can you take a look here:

   http://www.dirac.org/blog/view_by_permalink.php?the_id=103

at the graphic image at the bottom of the page?  

Pete
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] when is an html image sent?

2005-12-17 Thread Rod Roark
On Saturday 17 December 2005 01:55 pm, Peter Jay Salzman wrote:
 On Sat 17 Dec 05,  9:59 AM, Rod Roark [EMAIL PROTECTED] said:
  OK I couldn't stand it and did a test.
  
 Rod, can you take a look here:
 
http://www.dirac.org/blog/view_by_permalink.php?the_id=103
 
 at the graphic image at the bottom of the page?  

LOL.  You're welcome.  ;-)

So what was the problem?

-- Rod
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] when is an html image sent?

2005-12-17 Thread Peter Jay Salzman
On Sat 17 Dec 05,  2:09 PM, Rod Roark [EMAIL PROTECTED] said:
 On Saturday 17 December 2005 01:55 pm, Peter Jay Salzman wrote:
  On Sat 17 Dec 05,  9:59 AM, Rod Roark [EMAIL PROTECTED] said:
   OK I couldn't stand it and did a test.
   
  Rod, can you take a look here:
  
 http://www.dirac.org/blog/view_by_permalink.php?the_id=103
  
  at the graphic image at the bottom of the page?  
 
 LOL.  You're welcome.  ;-)
 
 So what was the problem?
 
 -- Rod

It was a mistake in my PHP.  I didn't get the error message because the
message got eaten by the graphic image.

If I looked at my browser's cache for the validation image with a binary
editor, I probably would've seen the error message.   :)  At least, that's
what I think happened.

Pete
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech