How to validate user logged in web application (php)? [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Good day.
Could someone please tell me how I can control that a user does not enter a web application more than once?
Currently I am controlling it by storing the session that is created in php in a field of a table and through javascript using ajax I consult it every 10 seconds. I think there must be a better way ... thanks !!!

And finally solved it by validating that the session created is different from the previous one, thus updating it and the previous user wanting to validate his session in order to make any request will realize that it does not exist and this will remove him from the application .

Related

How to keep items updated? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Is sending requests to server every second, the best way to keep list of items updated for all users? For example, if one user adds or deletes an item, all other users see the changes without refreshing page.
Not at all! That would be very network-consuming! You should either look for storage options with embedded listeners for changes like Firebase, or opt for some kind of publish-subscribe architecture where you notify the interested parts to pull data.

Save draft after page reload without registration via js or php [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
In my site, user can write a text. I want to make that, when the user reloads the page, the draft will appear. Without any registration.
I think, using ip as id is bad idea, because it can be library wifi network, for example, and as far as I understand, all connected devices would have the same ip.
What is the best way to unify client for that purposes?
You should use cookies if you want it to be saved for a long time
PHP:
setcookie('text_cookie', 'My text', time() + 3600);//To save for an hour
echo $_COOKIE['text_cookie'];//To show
use javascript keyevent and localstorage

input fields keeping the same information entered previously [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm working on a web development assignment and i'm a little stuck, so i have 2 pages, the first one is formulaire.html which contains a form that sends informations to my second page which is recap.php, and in that page i have a button that must send me back to the form page with all the informations entered previously still there, i can't use any php in the first page it must remain .html, i was thinking of creating a modify.js file but i would have to get my $_SESSION variables in it, which i don't know if it's possible, if anyone can help me out it'd be great.
did you try to use localStorage in javascript???
localStorage.setItem("key", "value");
var key = localStorage.getItem("key");

How to register a user using only javascript/ajax or jquery [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'm trying to register users using only javascript,ajax or jquery, i need to save the information of the users somewhere where i can get it even after the browser is closed,and the new information can't overwrite the old one.
I already tried saving into a xml file or txt file, but without success.
Check these out, one of it might help
http://www.w3.org/TR/IndexedDB/ - Indexed DB
http://www.w3.org/TR/webdatabase/ - Web Sql
http://www.w3.org/TR/webstorage/ - localStorage
You can as well try out a JavaScript Database here
http://www.taffydb.com/ still trying it out myself, hope this helps.

Prevent User from changing query string [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
In multi page application can we prevent user from skipping page by changing query string? If so How. Note: there are 13 pages but first 2-4 page (3 pages) are skipped by system if customer count ==1. If customer count is greater than 1 then none of the pages can(should) be skipped.
I don't think your question is complete; but in general terms, the query string only reflects the GET parameters. There is no way for an user to manipulate POST parameters without getting into the console. If the user can use console, no clientside data is safe; so to be foolproof, you would need to track the user in a serverside session.

Categories

Resources