[Resolved] vBulletin + LS Cache is ignoring my imloggedin=yes cookie

Status
Not open for further replies.
#1
LiteSpeed cache has worked wonders for saving our server when a page goes viral. The problem is, it's not respecting the "imloggedin=yes" cookie.

From inspect element, on the same page:

upload_2015-11-2_11-16-33.png

upload_2015-11-2_11-16-55.png

Why is that a hit??

You can reproduce the issue by registering (feel free to use a fake email, we don't verify) logging in, and trying to load this article:
Code:
https://www.psychopathfree.com/content.php?341-5-Things-Sociopaths-and-Narcissists-Say-to-Make-You-Feel-Crazy
It immediately looks like you've been logged out, and throws this error:

upload_2015-11-2_11-18-21.png

Here is my .htaccess file:

Code:
RewriteCond %{HTTP_COOKIE} !vbpf_imloggedin=yes
RewriteCond %{HTTP_COOKIE} !vbpf_imloggedin=
RewriteCond %{HTTP_COOKIE} !vbpf_imloggedin=
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{QUERY_STRING} !s=[a-fA-F0-9]{32}
RewriteCond %{QUERY_STRING} !product=vbnexus
RewriteCond %{REQUEST_URI} !^/(login|register|usercp|private|profile|cron|image)\.php$
RewriteCond %{REQUEST_URI} !^/admincp
RewriteCond %{REQUEST_URI} !^/modcp
RewriteRule (.*\.php)?$ - [E=Cache-Control:max-age=120]
Tagging @NiteWave who has been super helpful for these issues in the past :)

Thanks!
 
Last edited by a moderator:

mistwang

LiteSpeed Staff
#2
Please update the latest build of 5.0.7 see if it helps or not.

/usr/local/lsws/admin/misc/lsup.sh -f -v 5.0.7

We fixed a bug that could causes auto-logout problem when your server is behind CloudFlare.
 

NiteWave

Administrator
#4
Hi findingpeace,

RewriteCond %{HTTP_COOKIE} !vbpf_imloggedin=yes RewriteCond %{HTTP_COOKIE} !vbpf_imloggedin= RewriteCond %{HTTP_COOKIE} !vbpf_imloggedin=
should be
Code:
RewriteCond %{HTTP_COOKIE} !vbpf_imloggedin=yes
RewriteCond %{HTTP_COOKIE} !vbpf_userid=
RewriteCond %{HTTP_COOKIE} !vbpf_password=
?

I did quick tests, and can reproduce the issue you reported ... yes, not normal. looks weird issue.
but can you change above rules and see if it'll make any difference.
 
Last edited by a moderator:
#5
Hi @NiteWave , just found those as well and made the fix :) Same issue still occurs, unfortunately. I have to disable cache for now because it's causing so many bad errors.

I tried multiple htaccess rewriteconds that are blatantly impossible (always false), and it still applies the cache control header.

With more articles getting these traffic spikes, cache is the only thing that prevents our server load from going super high with MySQL requests. Really appreciate your help - hoping to get this resolved soon.
 

NiteWave

Administrator
#6
but from my tests just now, the issue looks fixed already.
I tested in Chrome browser.

when I login, I select an option "always log in" (the words may not be exact". maybe it's related.
have you done more tests ? clear all browser cache, then retest ...
 

NiteWave

Administrator
#9
does this issue exist from beginning or just occur recently ?
what changes made may be the cause do you think ?

I think the weird issue can be identified and fixed, but need collect more info first.
we can debug the issue during the idle time of the site.
 
#10
@NiteWave I just realized our host enabled Litespeed Cache in the actual config panel. I've disabled that (handling it purely through .htaccess) and things seem to be working smoothly now :) Thanks for your help!
 

NiteWave

Administrator
#11
Thanks for the update.
Enable cache through .htaccess is a good practice and easier to maintain.
better than enable it at the whole web server level -- it's not scalable for various web sites with various business logic.
 
#12
Agreed! Now that it's working properly, it's saving our site during these spikes in traffic! We went from CPU server load of 10+ (barely functioning, extremely slow page loads) back down to standard 1-2 range, super speedy. Litespeed rocks!!
 
#13
@NiteWave one last quick question, is there a reason why image.php has to be excluded in htaccess? That's a commonly accessed one for us. For guest users, would there really be any trouble in caching that?
 

NiteWave

Administrator
#14
just now visited your forum for a while. only 1 pattern is observed
domain.com/image.php?u=8125&dateline=1406313471&type=thumb

it's used to display forum member's avatar ? if so looks like it can be cached. -- you can try it anyway.

please confirm if it's used to generate random images to fight with spammer ?
this may be the reason it's included in .htaccess.
but these rewrite rules are a few years old and I have no access to a live vBulletin now.
we can work together to update those rules in our wiki based on your current live vBulletin.
 
Status
Not open for further replies.
Top