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™

Offline access to restricted content

s2Member Plugin. A Membership plugin for WordPress®.

Offline access to restricted content

Postby jesseAe » August 19th, 2011, 4:19 pm

I'm coding a web app and using s2member to restrict access to the wordpress page that displays the app interface.

I would like to make the app usable offline, but obviously a user cannot login offline and so would not be able to access the restricted app page.

So my question:
Is there any way for s2member to support offline access to restricted content?
User avatar
jesseAe
Experienced User
Experienced User
 
Posts: 13
Joined: August 19, 2011

Re: Offline access to restricted content

Postby Cristián Lávaque » August 19th, 2011, 10:25 pm

How would you suggest to achieve that?
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: Offline access to restricted content

Postby jesseAe » August 20th, 2011, 1:46 am

Coming from a Support Rep, your question comes off as kind of snarky.

I don't know all there is to know about wordpress authentication. If I did I would not have purchased the s2member pro plugin. However...

On this page:
http://codex.wordpress.org/WordPress_Cookies

It says this:
"If WordPress recognizes that you have valid, non-expired cookies, you go directly to the WordPress Administration interface."

So I was thinking that maybe if the cookie expiration can be changed then maybe there would be a way to get offline admin access for a set period of time. If this is ridiculous I would prefer you simply tell me this is ridiculous and not dress your ridicule in the guise of a question. Otherwise, can you help me?
User avatar
jesseAe
Experienced User
Experienced User
 
Posts: 13
Joined: August 19, 2011

Re: Offline access to restricted content

Postby Cristián Lávaque » August 20th, 2011, 2:28 am

Oh, no, I honestly didn't know how it could be done, which is why I asked you in case you had any ideas.

I actually think that what you mention about the cookies may work, but I'm not an expert in this.

I'll email Jason, the Lead Developer, to see what he thinks. :)
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: Offline access to restricted content

Postby jesseAe » August 20th, 2011, 4:48 am

Ah, very sorry I took your question the wrong way. I'm just touchy because I can't figure out whether it's possible or not myself. Thanks a lot for looking into this.
User avatar
jesseAe
Experienced User
Experienced User
 
Posts: 13
Joined: August 19, 2011

Re: Offline access to restricted content

Postby Jason Caldwell » August 20th, 2011, 2:53 pm

Thanks for the heads up on this thread.

Yes, all of WordPress ( including s2Member ), works on cookie-based authentication. That is, a User logs into the site, and remains logged in until cookie authentication expires. So as long as your application can work offline, you shouldn't have a problem recognizing the User as being logged-in, because cookies are stored on the client-side browser. Just be sure they click the "Remember Me" box when they log in, so that cookies remain in existence, even after the browser session is finished.

Cookie authentication in WordPress is handled by this core framework function:
http://codex.wordpress.org/Function_Ref ... uth_cookie

For better security, you might consider a JavaScript version of this routine, or at least something that checks the overall validity of the authentication cookie set by WordPress. I'm not sure you'll ever get something that's "as secure" as a server-side validity check, but I'm sure you could come up with a workaround for an offline app that would suffice.
~ 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: Offline access to restricted content

Postby jesseAe » August 20th, 2011, 4:05 pm

That's excellent. Thanks again Cristián for looking at this, and thanks for spelling it all out for me Jason. If I wind up writing that javascript authentication routine I will post a link here.
User avatar
jesseAe
Experienced User
Experienced User
 
Posts: 13
Joined: August 19, 2011

Re: Offline access to restricted content

Postby Cristián Lávaque » August 20th, 2011, 4:21 pm

Cool, Jesse. Looking forward to that. :)
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


Return to s2Member Plugin

Who is online

Users browsing this forum: No registered users and 2 guests

cron