sometimes anonymous comment form gets filled with another user's information when caching is enabled

luperry - October 29, 2006 - 09:46
Project:Comment Info
Version:4.7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:mfer
Status:closed
Description

when caching is enabled, sometimes the anonymous comment form gets filled up with information from another user. it returns to normal after clearing the cache table.

#1

Psicomante - December 12, 2006 - 11:30

I get the same problem. Can the content not to be cached?

#2

luperry - December 12, 2006 - 17:18
Status:active» needs review

sorry, I forgot to update this.

I tracked down the problem and fixed it myself. here is a patch. it's pretty simple, just use "default_value", instead of "value".

AttachmentSize
field_caching.patch.txt 474 bytes

#3

mfer - January 11, 2007 - 19:50

How can this value not be cached by going with #default_value? Isn't that the reason it can show up on other users pages? The caching.

#4

luperry - January 11, 2007 - 20:01
Status:needs review» active

currently it uses #value instead of #default_value. #default_value is filtered by drupal, #value is what gets cached.

but yes, you are correct, after further testing, it seems like it still doesn't fix the problem. I had expected drupal to filter #default_value after it caches the page, it seems this is not what's happening.

#5

mfer - January 11, 2007 - 20:02
Status:active» needs review

To avoid caching the way to go with this might be to have jquery do it.

#6

Christoph C. Cemper - February 6, 2007 - 00:12

Is this in the 5.x version? still got the same troubles

is this info being sent out in the html form? I thought they do it via cookie/JS

#7

mfer - February 6, 2007 - 03:42

The reason for the problem is that the info is stored in session and when caching gets turned on the info can be put into the cached page that everyone who sees the cached page will see.

Doing it with JS and a cookie is completely possible. Especially, not that jQuery is in core. I keep planning to write this. Maybe that will be my drupal task for the weekend.

Oh, and the problem is in 4.7 and 5.

#8

mfer - February 8, 2007 - 23:35
Assigned to:Anonymous» mfer

I spoke with Cainan about this. We are going to offer an option to have the remembering done via jQuery. This will only work in web browsers with javascript enabled but shouldn't run into the caching problem.

#9

mfer - February 23, 2007 - 20:26

There is now a second method to save the users information via jQuery and cookies. Check out the beta release at http://drupal.org/node/122084. Please, let me know if there are any bugs.

#10

mfer - April 1, 2007 - 21:50
Status:needs review» fixed

This has been fixed for drupal 5 using jQuery/cookies when caching is enabled. You can find the release at http://drupal.org/node/132977.

This fix doesn't work for 4.7 but the idea works. The fix is to upgrade to drupal 5 and the 5.x-2.0 version of the comment info module.

#11

Anonymous - April 15, 2007 - 22:01
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.