Any tips on creating a login system? on Username and Password comparison on a remote database? db is in MySQL
Jump to content
If you're sending the data to a remote server, encrypt before sending. Also consider using HTTPS for extra security.
Depending on what's on the remote, search Google for PHP/ASP-based systems and use one of those on the server-side, then you just need to send the data from your client application and listen for the response.
That's it in a nutshell, however the server should ALWAYS send a response, either positive or negative. if you don't respond, the client could wait (in principle) forever for the server to get back to it.
The client should probably have some form of time-out set so if the server doesn't respond it's treated as an error condition something like:
Send details to server
Wait until (timeout is reached) or (server sends response)
If timeout is reached
Flag an error and inform the user
Deal with the error condition
else if a response has been received
If the response is positive
Allow the user access
Throw an incorrect username/password condition
Not the greatest pseudocode in the world but you get the idea
The only thing is I don't know how to send data to the server sorry from mobile to server, but I can retrieve data from the server via JSON http://coronalabs.com/blog/2012/11/20/how-to-download-json-data-from-mysql-using-corona-sdk/
I've done an app recently which requires login. Here are few tips I would like to add to this topic
1> use https connection to send and receive data.
2> use POST in network request instead of GET. I used GET in my app and Apache was recording query string(&password=123123). By default Apache doesn't record POST parameter.
3> from device pass unique key and check from your server that's the request is from your App.
4> working with json seems to easy to work. I uses Rob's function to save and load json file into lua table. (Thank you Rob)
5> always check networking connection before network request. I use Rob's code found in the business app. (Thank you Rob)
6> encrypting parameter.. I've not done myself yet but will do in the next release
7> in the server end make sure you catch all errors and time to time review logs
Community Forum Software by IP.Board