I have an iOS application that connects to a Zend application API. When the user is logging in, the url and requests are the following:
url http://www.mydomain.com:82/user/login/user@gmail.com/40.636518/3.632524
<NSMutableURLRequest http://www.mydomain.com:82/user/login/user@gmail.com/40.636518/3.632524>
Where we have user email and latitude and longitude. Also, I send the user password through a parameter:
password=sha1password0123456789&
These are my routes:
routes.userlogin.route = '/user/login/:email/:latitude/:longitude'
routes.userlogin.defaults.controller = user
routes.userlogin.defaults.action = login
And this is the code of the controller:
...
$data = $this->getRequest()->getParams();
/* Here I print the $data object */
...
So, sometimes I'm receiving this as $data (this is OK):
Array(
[email] => user@gmail.com
[latitude] => 40.636518
[longitude] => 3.632524
[controller] => user
[action] => login
[password] => sha1password0123456789)
And some other times, I get this (this makes the login crash):
Array(
[controller] => user
[action] => login
[user@gmail.com] => 40.636301
[module] => default
[password] => sha1password0123456789)
Am I retrieving the parameters in the right way? The transaction it's done by POST method and I think I'm running ZendFramework-1.11.11.
EDIT: AFAIK this should not be a problem, but the location in the last crash was different from the request that went ok:
http://www.mydomain.com:82/user/login/user@gmail.com/40.636518/3.632524
vs
http://www.mydomain.com:82/user/login/user@gmail.com/40.636301/3.632206