Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi there,
I have installed image fupload and is working fine when I don't use memcache session handling. I am using memcache session handling to gain some performance gains. I am getting Upload Error 403 when I enable the memcache session handling. I tried to comment out all the lines in the code where it was refering to the drupal session table but still the error pops up.
Thanks
Mir Owais.
Comment | File | Size | Author |
---|---|---|---|
#3 | image_fupload-memcache.patch | 1.09 KB | mavimo |
Comments
Comment #1
vincentw CreditAttribution: vincentw commentedIn image_fupload.module line 137-139 ish, the module goes to the "session" table to validate the user's session.
Assuming you've set up memcache to handle sessions according to memcache's readme.txt...
In image_fupload.module, replace:
With:
This will look up user and session variables from memcache instead of the database. This also means if memcache stops working this won't work either.
I also don't know if there are any security issues.
Hopefully someone can write a proper patch at least.
Comment #2
grandcat CreditAttribution: grandcat commentedThere's no patch at the moment.
Comment #3
mavimo CreditAttribution: mavimo commentedInto attachment you can find a patch to use image_fupload with memcache module.
Comment #4
vincentw CreditAttribution: vincentw commentedThanks!
Comment #5
frankcarey CreditAttribution: frankcarey commentedQuestion for you all: Is there no abstraction layer for using sessions making the code the same for memcache or not? If not is there a reason we can't use a simple if statement so that there is no reason to patch? Thanks!
Comment #6
mavimo CreditAttribution: mavimo commented@frankcarey: memcache do not support search into query, is key-value DB, and you must load complete sessions data and after check if user can upload file and validate post data. When mysql you can use a query to select correct information you require.
I can try to remove if, but i'm not sure is a good idea :| (perfomance go down).
Comment #7
frankcarey CreditAttribution: frankcarey commented@mavimo I should have looked at the actual patch. What I was suggesting is TO use an if (test if memcache was running). It looks like you've already integrated that into your code though, so should be good. I'll have some time to test this out next week.
Comment #8
mavimo CreditAttribution: mavimo commented@frankcarey: any news from your test?
Comment #9
sdelbosc CreditAttribution: sdelbosc commentedJust to track the issue...
Comment #10
geerlingguy CreditAttribution: geerlingguy commentedSubscribe. Having session issues behind a corporate firewall/proxy in FireFox.
Comment #11
mrwhizkid CreditAttribution: mrwhizkid commentedI can confirm that the patch from #3 works for memcache sessions.
Thanks!
Comment #12
3dloco CreditAttribution: 3dloco commented#3 works very well for me too...thanks!
Comment #13
jjemmett CreditAttribution: jjemmett commentedworks for me.