captcha image not showing for authenticated users. admins yes, anon yes.
brettev - November 10, 2008 - 19:55
| Project: | CAPTCHA |
| Version: | 5.x-3.x-dev |
| Component: | Image Captcha (image_captcha) |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I have a captcha showing up for admin user, anonymous user, but regular authenticated users don't see the image.
I have commented out the 2 lines it says to inside the image_captcha_image function for testing, and I put the url in, and I get a white page with the following code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8"></HEAD>
<BODY></BODY></HTML>Any hints?

#1
I had a similar problem but it was the anonymous users that were not seeing the CAPTCHA image. Is it that the placeholder for the image is there but the image is not rendering?
For me, the issue was caused by the Session settings. My anonymous user account (uid = 0) did not have a record in the {users} table preventing any sessions from loading and thus hindering the CAPTCHA. While your authenticated users are logged in they likely have sessions running. You can check this by using the Devel module's Session Viewer feature or doing a print_r($_SESSION) on a page.
If anything, this should be able to give you a starting point to try and trace the issue.
- Chris
#2
I had read that in another post somewhere. I do have that record in the users table. Is there anything else you know of that would trigger that html to be output when you request the image directly?
#3
I want to make sure I understand the issue. The HTML for the captcha is being displayed on the page, but the src to the generated captcha image is not valid and thus not displaying the image for authenticated users?
Have you checked the session information? That would be the first place I would start. Using the devel module, I get the following session output when looking at a page with a captcha on it (using the Forward module):
[image_captcha] => Array
(
)
[captcha] => Array
(
[forward_form] => Array
(
[50f05ede9e8c6147f933f53bd03cda6d] => ttt%TX
[success] =>
)
)
If the SRC is valid and your sessions are taking captcha variables, then it must be something in your permissions. It could be something other than the captcha permissions. I'll keep my brain running and see if I can come up with an answer.
- Chris
#4
using the devel module, i see a line like this:
sess_write
UPDATE sessions SET uid = 39, cache = 0, hostname = 'my ip here', session = 'og_last|N;image_captcha|a:1:{i:702517095;s:5:\"mM5G8\";}captcha|a:1:{s:17:\"contact_mail_page\";a:2:{s:32:\"92b5a1c805f8b2fef70d2f200f3a4c18\";s:5:\"mM5G8\";s:7:\"success\";b:0;}}', timestamp = 1227201028 WHERE sid = '6936d9eb92b20de9da3dcc8aef1c866e'
but when i go look at the database, the session data field only has
og_last|N;
in the field. Do i need to be looking for a module that is writing over the session stuff? the other weird thing is that the sess_write command above is the 2nd to last line of the devel output, and the last one doesn't overwrite it. How on earth is it getting erased from the database?
by the way, i run the 'session viewer' function from devel block, and all it shows is the og_last thing from above too.
does this help at all? i'm still super confused how it is getting erased.
#5
It looks like there may be a conflicting module. The session data is there. Are you running Organic Groups? I'm guessing judging from the og_last entry. If that is all that is there when you run the session_viewer, it looks like it may be the culprit. If you can, I would try disabling some modules to see if you can isolate the issue.
If you are running OG, they may have something similar in their issue tracking.
Let me know what you find out.
- Chris
#6
I ended up switching to re-captcha. I went through the 80+ modules I am using, and it still didn't work, so i switched and it works fine
#7
Hmm, good to know. I actually ran into more issues today with the captcha throwing errors on some forms, but not others. Sounds like re-captcha may be the way to go from here out.
Sorry I couldn't be more help, but I'm glad you found a solution.