How can I use local HTML5 storage alongside third-party PHP, use it for php sessions and store other information that php uses

I looked on the Internet for a while, and the local HTML5 repository looks like something useful to me and the solution to my problem that I encounter with PHP sessions, the problem is that they are incompatible, even if I made them remember me in next time I come to my homepage. I got to the login page, this is not always, but often, PHP sessions turn out to be inconsistent for me.

I would like to know if I can use local storage for persistent session storage that php can use, all the examples I saw on the javascript website.

+5
source share
3 answers

Localstorage is designed to save the client part of the data so that it can be accessed even if the client is offline, in which case, as you said, it accesses JavaScript.

PHP sessions store information on a server. Using localStorage is also a bad idea, as it can be modified by the client, so the client can claim to be registered as another user, which is obviously a security issue.

Is there a problem with your PHP configuration? Is there a timeout value for a PHP session cookie that you can change?

+9
source

. PHP API .

+3

, , PHP. , , ... -. , , -, , ( )?

, javascript, , PHP js, localstorage.

+3

All Articles