I am creating a location-based web app that will primarily run on a mobile browser. It is HTML 5, javascript And will be coded with PHP. I want to persuade the user to log in practically frequently and frequently. I want to login them (via PHP) and then I want to be logged in for X amount.
I know how this is done with cookies, but I am experimenting with HTML5 local storage. If I use local storage, then I have to verify all the code with javascript and send it to php via ajax. As I am thinking about how to achieve this, I am surprised that using local storage is really worth it. What I think is more secure than cookies, because the data is not transmitted with every HTTP request, and it can not be accessed by cross-domain but modern browsers like iOS and Android, access to cross-domain cookies Do not do to stop?
Am I making trouble on myself by using local storage? In this case, what are the reasons for choosing local stores on cookies? There are two separate uses in cookies and local storage, mainly to read by cookies server side, and local storage is read by client slides.
If this customer needs this data, then yes, use local storage (you will save bandwidth by not sending cookies to every HTTP request in the headers) However, if you are not Simply use cookies to send stick server to make additional HTTP requests (through AJAX), cookies are a little overkill if you are all then server-side this data is available Is.
Comments
Post a Comment