PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Safari is redirected to login

s2Member Plugin. A Membership plugin for WordPress®.

Safari is redirected to login

Postby dwllnet » April 28th, 2011, 3:51 pm

First off, great plugin.

We have ran WP and s2Member on our site for over a year now without to many issues.

But in the last month, Safari started having problems accessing member level content.

I've went through the disabling plugins, checking my if statements.

Here's our setup:

Version: 3.5.8
Stable tag: 3.5.8
Framework: WS-P-3.5
WP: 3.1.2 ( Just updated today )
Member Level Content controlled under one category.
Exec-PHP to run php at the content level content, pages and post.

Only on Safari, a registered uses, level 4 can log into our site. Once in, if they try and access member only content they are redirected to wp-login.php?s2member_seeking=post-#&s2member_level_req=4.

If the member logs in and before accessing member only content, they empty Safari's cache they will be allowed to access the member only content.

Again, I've disabled all other plugins, so I'm thinking it maybe something with s2Member.

Thanks up front for any help on this problem.
-Daniel
User avatar
dwllnet
Registered User
Registered User
 
Posts: 10
Joined: April 28, 2011
Location: Georgia

Re: Safari is redirected to login

Postby Cristián Lávaque » April 28th, 2011, 5:22 pm

Hi Daniel. :)

Did you also try the TwentyTen theme? I don't know if your theme does any kind of caching that may be causing the issue?

I'll notify Jason about this problem you're having.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Safari is redirected to login

Postby dwllnet » April 28th, 2011, 7:41 pm

We do have WP SuperCache running, but we fixed that problem a while back by excluding the members only URL.
The theme we use does not cache html, it does howevery cache images.

And no I haven't tried another theme. The site has been using the same theme from the start.
I will try WP's default theme, tonight and post the results.

Thanks for the help.
-Daniel
User avatar
dwllnet
Registered User
Registered User
 
Posts: 10
Joined: April 28, 2011
Location: Georgia

Re: Safari is redirected to login

Postby dwllnet » April 29th, 2011, 10:39 am

Switch to Twenty Ten 1.2 theme. I'm still having the same problem.

Thanks
-Daniel
User avatar
dwllnet
Registered User
Registered User
 
Posts: 10
Joined: April 28, 2011
Location: Georgia

Re: Safari is redirected to login

Postby Jason Caldwell » April 30th, 2011, 6:58 am

Hi Daniel. Have you seen this post regarding www vs. without?
viewtopic.php?f=36&t=1066

The fact that it's a browser issue, suggests that it's either a cache plugin causing confusion for you, or that it's a cookie issue, possibly related to the www issue I mention in that thread. Please report back if you can. I can confirm that all of my tests in Safari seem fine, but I would like to get to the bottom of this. Thanks in advance for your patience.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Safari is redirected to login

Postby dwllnet » April 30th, 2011, 7:27 am

Jason,
Yes, I have read that post.
We use the host name www in all of our URLs.
WordPress address (URL): http://www.laramyk.com
Site address (URL): http://www.laramyk.com

I've removed all caching plugins. The weird thing is that it's just Safari.

Also, we have a testing site, we can do about anything you want.

Thanks for the help.
-Daniel
User avatar
dwllnet
Registered User
Registered User
 
Posts: 10
Joined: April 28, 2011
Location: Georgia

Re: Safari is redirected to login

Postby Jason Caldwell » April 30th, 2011, 8:21 am

Thanks Daniel. I just created an account on your site with Username: jasontest
Please upgrade me to Level #4 and provide me with instructions on how to reproduce this in Safari. Also, can you please tell me which version of Safari this problem occurred with, and was this running on a Mac, or Safari for Windows?
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Safari is redirected to login

Postby dwllnet » May 2nd, 2011, 9:26 am

Jason, I moved your account over to our test site.

You should have received an email with the password.

Safari 5.0.5 and 5.0.4 on OS X, have not tried Safari on Windows.

Thanks
-Daniel
User avatar
dwllnet
Registered User
Registered User
 
Posts: 10
Joined: April 28, 2011
Location: Georgia

Re: Safari is redirected to login

Postby dwllnet » May 2nd, 2011, 10:28 am

Jason,
Login into the test site, access http://[Test Site]/welcome/ click on "You may now order online.".
On Safari it will redirect you back to the login screen.

Thanks
-Daniel
User avatar
dwllnet
Registered User
Registered User
 
Posts: 10
Joined: April 28, 2011
Location: Georgia

Re: Safari is redirected to login

Postby dwllnet » May 2nd, 2011, 8:20 pm

Update:
Testing different s2Member configureations.

I've changed s2Member's ACLs from Category to Page,Post with the key word all.
Under Safari I'm seeing the same results.

But one weird behavior is that the Login Welcome Page works as it should.
Thanks
-Daniel
User avatar
dwllnet
Registered User
Registered User
 
Posts: 10
Joined: April 28, 2011
Location: Georgia

Re: Safari is redirected to login

Postby tkittredge » May 2nd, 2011, 11:36 pm

I am seeing the same problem, also on Safari 5.0.5 OS X 10.6.7. Please see my detailed recreation scenario and comments here... viewtopic.php?f=4&t=6281

Simply... Any individual restricted page "touched" AFTER dumping the browser cache (Safari, Empty Cache...) but BEFORE login will not be accessible after log in. Those untouched will be accessible.

Let mew know if I can provide more details.
User avatar
tkittredge
Registered User
Registered User
 
Posts: 20
Joined: May 2, 2011

Re: Safari is redirected to login

Postby dwllnet » May 3rd, 2011, 12:28 am

Another update:

I've updated WP Permalink Settings from Custom Structure "/%category%/%postname%/" to WP's default settings, p=123.

My testing shows Safari doesn't redirect under this config.

Can some one verify this?

Thanks
-Daniel
User avatar
dwllnet
Registered User
Registered User
 
Posts: 10
Joined: April 28, 2011
Location: Georgia

Re: Safari is redirected to login

Postby tkittredge » May 3rd, 2011, 6:25 am

Pemalinks in my case are configured to use the default URL structure and exhibit the problem... e.g. /?page_id=239

See example links under "Platform" and "Configuration" at... viewtopic.php?f=4&t=6281#p13960
User avatar
tkittredge
Registered User
Registered User
 
Posts: 20
Joined: May 2, 2011

Re: Safari is redirected to login

Postby Jason Caldwell » May 3rd, 2011, 7:07 pm

Investigating now.
Thanks for the details guys.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Safari is redirected to login

Postby dwllnet » May 3rd, 2011, 7:22 pm

If you need anything just shoot an email.

Thanks again.
-Daniel
User avatar
dwllnet
Registered User
Registered User
 
Posts: 10
Joined: April 28, 2011
Location: Georgia

Re: Safari is redirected to login

Postby Jason Caldwell » May 3rd, 2011, 8:26 pm

Thank you.

I'm still testing this, but I suspect it's related to 301 permanent redirects implemented by s2Member. My research shows that some versions of Safari will cache a 301 redirection, even though WordPress/s2Member sends no-cache headers before the redirection.

This is unexpected behavior, because most browsers will respect no-cache headers, and NOT cache the redirection. However, a gray area emerges on this according to the specs, so we may need to seek an alternative solution; in order to avoid this possible bug in Safari.

In fact, some articles I researched mention that Safari might even cache this into memory;
making it difficult to clear with common techniques ( i.e. Safari -> Empty Cache ).


A possible solution.
90% Resolved ( pending a full resolution though )

Please create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
Code: Select all
<?php
add_filter
("ws_plugin__s2member_content_redirect_status", "content_redirect_status");
    function content_redirect_status($status = 301){ return ($status = 302); }
?>
* But please note. This has a potentially harmful side effect. s2Member sends a 301 redirect status ( by default ), in order to avoid duplicate content issues with search engine spiders/crawlers.

By using a permanent redirect ( 301 status ), s2Member tells search engines NOT to index protected pages of your site, which would only redirect to the Membership Options Page anyway. This is why 301 redirects are recommended for protected pages that are redirected.

If you use a 302 redirect instead, you might avoid this Safari issue; but Google might try to index all of your protected URLs then, which would only lead a search engine to the same page over and over again ( i.e. your Membership Options Page ).


I'm open to suggestions/feedback on this topic please.

See Also: http://stackoverflow.com/questions/2954 ... 1-redirect
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Safari is redirected to login

Postby dwllnet » May 3rd, 2011, 9:43 pm

Jason,
The hack worked for me.

Just a suggestion, way do a redirect in the first place. For us, I don't want Google to index my members only URLs.

Could you insert content into the request.

Let's say s2Member had a configuration option that would allow you to assign default content to be displayed when a user doesn't have the correct access level. This content could come from pages or post, even hand coded option in s2Member settings for each level.

For spiders/crawlers, write a robot.txt with your members only content urls not allowing them to be index.
Could s2Member write the file?

Thanks
-Daniel
User avatar
dwllnet
Registered User
Registered User
 
Posts: 10
Joined: April 28, 2011
Location: Georgia

Re: Safari is redirected to login

Postby Cristián Lávaque » May 3rd, 2011, 11:29 pm

In that hack, can't you check the browser used and only change to 302 if Safari?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Safari is redirected to login

Postby Jason Caldwell » May 3rd, 2011, 11:38 pm

Yes, perhaps that's what we need to do overall. Detect browsers vs. spiders/crawlers. Issue 302's to browsers, and 301's to spiders/crawlers. Is this a viable solution you think?
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Safari is redirected to login

Postby Cristián Lávaque » May 4th, 2011, 1:22 am

Yeah, since the content is the same, I don't see Google complaining about giving them something different than the user getting the result in their search engine.

But I'd still give the 301 to browsers that handle it properly, or would you rather prevent new unexpected behaviors as Safari's?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Safari is redirected to login

Postby Jason Caldwell » May 4th, 2011, 9:16 am

Gotchya. Yes, I'm thinking that it might be a good preventative measure overall. For instance, if this is happening in Safari ( i.e. WebKit ), then it could also be affecting some iPhones and some versions of Google Chrome, both of which are powered by WebKit like Safari is.
100% Resolved ( update coming in next release )
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Safari is redirected to login

Postby Cristián Lávaque » May 4th, 2011, 11:24 am

Ah, got it. I agree with you. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Safari is redirected to login

Postby tkittredge » May 4th, 2011, 3:09 pm

Changing the content redirect status as suggested from 301 to 302 RESOLVES the issue in my configuration... viewtopic.php?f=4&t=6281

Correct me if I am wrong, but with a status of 302, search engines and crawlers would simply index and reindex the MOP but still be unable to access restricted content.

Thanks for the response to a challenging issue.
User avatar
tkittredge
Registered User
Registered User
 
Posts: 20
Joined: May 2, 2011

Re: Safari is redirected to login

Postby Jason Caldwell » May 4th, 2011, 3:54 pm

Thanks for the follow-up.
tkittredge wrote:Correct me if I am wrong, but with a status of 302, search engines and crawlers would simply index and reindex the MOP but still be unable to access restricted content.

Thanks for the response to a challenging issue.

Yes, you are absolutely correct.

However, with 302s, I've seen spiders end up with a set of search results like this:
Code: Select all
Membership Options Page
http://example.com/protected-page-1/

Membership Options Page
http://example.com/protected-page-2/

Membership Options Page
http://example.com/protected-page-3/

Membership Options Page
http://example.com/protected-page-4/
Ultimately resulting in duplicate content warnings.

I think the detection of search engine crawlers/spiders should work nicely though. We'll get this updated in the next release. That way browsers get 302 redirects, but spiders/crawlers get 301 redirects.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Safari is redirected to login

Postby AnnaSkye » May 9th, 2011, 11:22 pm

I have read thru this thread and currently experiencing a similar problem with users in Safari. I've read about the negative effects on protected pages, but in my install of S2Member I'm only protecting file downloads. How will this hack effect my pages being indexed with Google?

Thanks,
AnnaSkye
User avatar
AnnaSkye
Registered User
Registered User
 
Posts: 23
Joined: May 4, 2011

Next

Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron