0

I'm currently writing a mobile application in php. I added a IP filter, so that only clients in my home network can access the app.

Now I would like to implement a method to register mobile devices over my local network, so they can access the website outside of my network. I thought of sharing a cookie but that does not seem like a smart implementation.

Any suggestions?

Nbert.
  • 143
  • 2
  • 9
  • Database with a list of accessible IP's? – James Lalor Apr 25 '16 at 11:40
  • That is what I did. But my mobile clients have changing ips depending on the location. This is why I want to register them the first time they access my local network. – Nbert. Apr 25 '16 at 11:42
  • store clients based on MAC addresses instead of ip's? Unless you give each device a fixed static ipaddress as stated above, however this would have to be unique per device and could be wasteful of addresses – Juakali92 Apr 25 '16 at 11:43
  • Right, if it's LOCAL only, then: http://stackoverflow.com/a/1420402/4022234 – James Lalor Apr 25 '16 at 11:44
  • Alternatively, a cookie could work, as long as you store it and grant it access, but ofc if this cookie expires (just set a really long exp date) or if the user clears all data or what not, has to be redone. – James Lalor Apr 25 '16 at 11:47
  • That pretty much sums up my thoughts on this. A cookie would be unreliable because it could expire or be deleted. The mac address only gets send via local, so that is not an option since I want to be able to grant access via unknown ip addresses. – Nbert. Apr 25 '16 at 11:58

1 Answers1

0

You can try to make a service

in codeigniter, you can use this http://code.tutsplus.com/tutorials/working-with-restful-services-in-codeigniter--net-8814

keronconk
  • 359
  • 2
  • 10