Page 1 of 1

Login to WP database that is hosted on another domain.

Posted: Tue Apr 15, 2014 2:38 am
by sunil_rinku

I want to call Wordpress sevice and login user to appery APP. I have to use mysql database for now and php for now. I know there is CORS avaialble and I can accept the request and return session IDs if user is valid.

But, every time I made request to my page it regenerates session ID. is there any way to persists session between Appery.io app and third party domain. I believe backbone has ways to do this. Does appery.io has similar functionality or any hacks so this can be achieved easily.


Login to WP database that is hosted on another domain.

Posted: Tue Apr 15, 2014 4:44 am
by Illya Stepanov

Hello Sunil,

Please specify following things:
ol
liIs it right you have external server with DB and some PHP code wichi is implement the REST services?/li

liIf you have a REST on your external server you would have there a LOGIN api request. Is it right?/li

liIf you have LOGIN api request, why do you call it all the time? It should be invoked only when sessionId does not exists or expired./li
/ol
Please clarify this things for us and we will help you.

Common logic for your purposes:
ol
liIN the login page of your app you create login REST service./li

liWhen user entered credentials you fill with it your login REST service. And invoke this service./li

liOn success login REST service you will store session token in the LSV./li

liWhen you call other REST requests you just pass this session token stored in the LSV./li

liWhen user make logout action you just clear this LSV session token./li
/ol
That's all.

Regards.


Login to WP database that is hosted on another domain.

Posted: Sun Apr 20, 2014 4:28 pm
by sunil_rinku

Hey,
I guess your common logic will work. Just wanted to make sure I am on right path.

What is LSV by the way? Do you suggest cookie or HTML5 session?

Regards,
Sunil


Login to WP database that is hosted on another domain.

Posted: Sun Apr 20, 2014 5:41 pm
by Igor

Hello,

[quote:]What is LSV by the way?[/quote]
This is localStorage variable.
a href="http:/eintohtml5.info/storage.html" rel="nofollow"http:/eintohtml5.info/storage.html/a
[quote:]Do you suggest cookie or HTML5 session?[/quote]
You can use HTML5 session.
This doc should be helpful:
http://docs.appery.io/tutorials/build...