Home  >  Article  >  Backend Development  >  How to determine whether a user enters a page for the first time?

How to determine whether a user enters a page for the first time?

PHP中文网
PHP中文网Original
2017-03-23 13:48:586406browse

Question:

Something like a small prompt after updating certain functions or a new user prompt

How to judge whether this user has entered this page for the first time

Is there any good method besides cookies

Solution:

1. I think this problem can be stored in a separate table, because some small functions are likely to be updated in the future, and pop-up information can also be stored in this table.

Second, there is usually a way
1. Save it in localstorage. The disadvantage of this is that users will see it multiple times when they change browsers or computers.
2. Store in the cache, and check whether the prompt corresponding to userId has popped up every time the user logs in.

3. Add one more field to the database membership table. The value defaults to 0. Check whether the field is 0 when logging in. If If yes, change it to 1 (1 means it is not the first time to log in)

Related articles:

Use PHP to determine whether the user is logging in for the first time that day

How to use the PHP website to determine whether the user is accessing from a mobile phone

Use php to determine whether the user follows the WeChat public account

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn