can't log in or create new users on mediawiki

Balder VC lists at redlab.be
Mon Aug 17 18:31:02 CEST 2015


As advised on mediawiki's wiki (
https://www.mediawiki.org/wiki/Manual:Varnish_caching )

 # Pass requests from logged-in users directly.
        if (req.http.Authorization || req.http.Cookie)
           {return(pass);}      /* Not cacheable by default */
 

you could also check req.http.Cookie's content to check if the session
cookie is there, and not unset them in this case. In other cases when
user is not logged in, it's probably safe to unset them and show the
static version of the page from cache, instead of the logged in version.




Regards
Balder

On 08/17/2015 05:52 PM, Tim Dunphy wrote:
>
>     maybe you have a  unset req.http.Cookie; that shouldn't be called
>     when a user is logged in/going to login.
>     Maybe try to find a way to always call (pass) when a user is
>     logged in. I think you 'd be better of not caching when a user is
>     logged in.
>     Of course we don't know the use case of your mediawiki, nor do I
>     know mediawiki myself . 
>
>
> That was it! I did in fact have  unset req.http.Cookie; set earlier in
> my VCL! So now I can log in. Good stuff! However if I disable  unset
> req.http.Cookie; altogether my site does not cache at all. Is there
> any way to allow cookies just for the login page in the following section?
>
>  if ( req.http.host == "wiki.example.com <http://wiki.example.com>" &&
> req.url ~  "^/(index\.php)?\?title=Special:UserLogin(.*)" ) {
>     return (pass) ;
>    }
>
> Thanks,
> TIm
>
> On Mon, Aug 17, 2015 at 11:27 AM, Balder VC <lists at redlab.be
> <mailto:lists at redlab.be>> wrote:
>
>     On 08/17/2015 05:02 PM, Tim Dunphy wrote:
>
>     >
>     > So I think I need to find a way to preserve the cookie that's
>     being used to identify the user at the end of the URL, which I'm
>     pretty sure will be a random string. Can you help me find a way to
>     do this?
>     >
>     > Thanks,
>     > Tim
>     >
>     > On Mon, Aug 17, 2015 at 2:24 AM, Geoff Simmons <geoff at uplex.de
>     <mailto:geoff at uplex.de> <mailto:geoff at uplex.de>
>     <mailto:geoff at uplex.de>> wrote:
>     >
>
>
>     maybe you have a  unset req.http.Cookie; that shouldn't be called
>     when a user is logged in/going to login.
>
>     Maybe try to find a way to always call (pass) when a user is
>     logged in. I think you 'd be better of not caching when a user is
>     logged in.
>     Of course we don't know the use case of your mediawiki, nor do I
>     know mediawiki myself .
>
>
>     Regards
>     Balder
>
>     _______________________________________________
>     varnish-misc mailing list
>     varnish-misc at varnish-cache.org <mailto:varnish-misc at varnish-cache.org>
>     https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
>
>
>
> -- 
> GPG me!!
>
> gpg --keyserver pool.sks-keyservers.net
> <http://pool.sks-keyservers.net> --recv-keys F186197B
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20150817/cfbce5ca/attachment.html>


More information about the varnish-misc mailing list