Click on the menu to collect red envelopes, the rule is to click a maximum of 1 red envelopes, and now the problem is sometimes card can be out of two red envelopes so businesses should not be lost to death, I did before is through the database record screening, led the Red Packet Network database cuttings records, but tried useless, after thinking through the session, for each user, In the red envelopes to a session, go out to clear the session, so that will not cause users to appear two of the same red envelopes, but the session did not test, we have what good way??
Reply content:
Click on the menu to collect red envelopes, the rule is to click a maximum of 1 red envelopes, and now the problem is sometimes card can be out of two red envelopes so businesses should not be lost to death, I did before is through the database record screening, led the Red Packet Network database cuttings records, but tried useless, after thinking through the session, for each user, In the red envelopes to a session, go out to clear the session, so that will not cause users to appear two of the same red envelopes, but the session did not test, we have what good way??
Click, execute a function, this function is to collect a red envelope, it is impossible to card this function to execute two times it?
If the session is used, if the user receives a red envelope, empties the cookie, and then re-receives the red envelope, the same user will receive multiple issues
It is recommended to use Redis to store the user information of the received red envelopes, to prevent users from emptying the cookie brush red envelopes, nor two of the same red envelopes.
can be resolved with token hidden domain.
Check tokens when requesting a red envelope, and delete after verification is successful.
Unable to trust the input from the client