sunil_rinku
Posts: 0
Joined: Thu Jan 23, 2014 3:17 am

Login to WP database that is hosted on another domain.

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.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Login to WP database that is hosted on another domain.

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.

sunil_rinku
Posts: 0
Joined: Thu Jan 23, 2014 3:17 am

Login to WP database that is hosted on another domain.

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

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Login to WP database that is hosted on another domain.

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...

Return to “Issues”