Page 1 of 1

Issue with Membership Options Page for logged users

PostPosted: November 17th, 2011, 6:08 am
by CyberOto
Hi,

I have setup S2Member and have 2 protected pages - one that require level 0 and one with level 1.

When non logged user is trying to access both of them, he is properly redirected to the page set in Membership Options Page.

When user with level 0 is trying to access the page for level 1, he is redirected to the Membership Options Page, but the page is blank. I can see the GET parameters and all, but no content. No HTML code returned.

If I use this URL with all parameters in other browser (not logged in) I got the page shown.

Do I miss something in configuration of S2Member?

Any advice is appreciated.


Regards,

P.S.
Used the search, but I have not found similar topic :roll:

EDIT:

Aw ... found the problem:

In case of user level 0 trying to access level 1 page I got 414 Request-URI Too Long return code :o

What can I do for that ?

Re: Issue with Membership Options Page for logged users

PostPosted: November 17th, 2011, 8:11 am
by Eduan
Try going to WP Admin -> s2Member -> General Options -> URL Shortening Service Preference and check every thing there.

Hope this helps. :)
Also remember to report back,
otherwise you leave me worrying. ;)

Re: Issue with Membership Options Page for logged users

PostPosted: November 17th, 2011, 8:36 am
by CyberOto
Hi Eduan,

Just checked there - I have selected goo.gl for shortening. As far as I get it this is used only for links in e-mails ?

For some reason if the parameters are above 230 bytes i got this error. Here are the GET parameters that are generating 414 Error Code:

Code: Select all
?_s2member_seeking[type]=page&_s2member_seeking[page]=519&_s2member_seeking[_uri]=L253YS1idWxnYXJpYS9tZW1iZXJzLw%3D%3D&_s2member_req[type]=level&_s2member_req[level]=1&_s2member_res[type]=page&s2member_seeking=page-519&s2member_level_req=1


If I manually shorten them below 230 bytes - all is working. For example:
Code: Select all
?_s2member_seeking[type]=page&_s2member_seeking[page]=519&_s2member_seeking[_uri]=L253YS1idWxnYXJpYS9tZW1iZXJzLw%3D%3D&_s2member_req[type]=level&_s2member_req[level]=1&_s2member_res[type]=page&s2member_seeking=page-519

is working and the page is loading.

I have removed the last parameter
Code: Select all
&s2member_level_req=1


Going to dig-in into ws_plugin__s2member_url_shorten to see if this could help.


Regards,

P.S.
Contacted the hosting support and they claim that Apache LimitRequestLine is set to 8K, but still have this error.

Re: Issue with Membership Options Page for logged users

PostPosted: November 17th, 2011, 9:46 am
by CyberOto
Found some odd issue.

If I'm logged as administrator I can load with no issue the long URL that is generating 414 error code for level 0 - 4 members. Logged out completely, and the same long URL is also loading the page contents.

:?

Any way to strip some of the parameters that are passed via GET. A way that do not involve hacking in the code directly that is :mrgreen:

I'm wondering about stripping one variable _s2member_req[level] or s2member_level_req that contain one and the same info. This is for illustration only.


Regards,

Re: Issue with Membership Options Page for logged users

PostPosted: November 18th, 2011, 2:49 am
by CyberOto
Anyone ?

I'll appreciate any suggestion.


P.S.
a.k.a. shameless bump :roll:

Re: Issue with Membership Options Page for logged users

PostPosted: November 21st, 2011, 2:35 am
by Cristián Lávaque
Thanks for reporting this important issue! I'm notifying Jason so he can look into it and solve it. :)

Re: Issue with Membership Options Page for logged users

PostPosted: November 21st, 2011, 3:16 pm
by Jason Caldwell
Thanks for the heads up on this thread.

414 Request-URI Too Long

By default, web servers and browsers set fairly generous limits on the length for URLs. Up to 2048 or 4096 characters. I'm not aware of any browser with a limit under 2048 bytes, and none of s2Member's URLs exceed that, even in their full format before having been shortened, in some specific cases ( mostly to prevent issues with email clients ).

If you are receiving this error, here are some things I'd have a look at.

1. Do you have any plugins installed into WordPress, which might be security-related, with a configuration that could trigger this error? If so, try disabling those plugins, or scanning back through your configuration of them a bit.

2. Do you have any security-related Apache or PHP extensions running on your server, such as Suhosin, mod_security, suPHP, which might be configured with abnormal settings, thereby causing this issue? See also: viewtopic.php?f=36&t=14787

3. Ask your hosting company again. If the issue cannot be resolved on your own, or you don't have access to your Apache and/or PHP error logs to find out what's actually happening, or what is triggering this error, a hosting company should be able to help you with this.

You mentioned this was not a problem when you are logged in as an Administrator, which makes me think it could have something to do with a plugin. So you might spend some more time on #1 above.

Please let us know what you find out.

Re: Issue with Membership Options Page for logged users

PostPosted: November 21st, 2011, 11:49 pm
by CyberOto
Hi Jason,

It turned out that it was SecureWP plugin that is messing around. If the option to Protect WordPress against malicious URL requests is turned on, I got the 414 Error.

Checked the code and found out that this function is limiting the whole URL string to be less than 255 bytes. Once I corrected that - all started to work as intended.

Thank you for your suggestion and keep up the good work.


Regards,

Re: Issue with Membership Options Page for logged users

PostPosted: November 21st, 2011, 11:59 pm
by Jason Caldwell
Thanks for reporting back on this.
~ MUCH appreciated.

Re: Issue with Membership Options Page for logged users

PostPosted: November 22nd, 2011, 3:50 am
by CyberOto
I have added a post to SecureWP support thread on wordpress.org with a simple description and solution I used for myself:

http://wordpress.org/support/topic/secure-wordpress-and-s2members


Regards,