A
A
Alexey Vesnin2017-10-14 14:31:30
PHP
Alexey Vesnin, 2017-10-14 14:31:30

Saving data of get analytics parameters into session, how to do it right?

Hello. Such a question: When a user switches from an advertising company or with any other Get-parameters, I want to write this data in the session, and then send it through the form or write it to the database.
I know how to write data to the session, I don’t want to send GET parameters to the form right away, since the visitor can still walk around the site and they can be lost.
Questions:
1. How expedient is it to write this data to the session
2. The question is how to correctly identify different users so that they do not overwrite each other, and set the session lifetime for one user, for example, 60 minutes (only for a specific site)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2017-10-14
@alexvdv

1. You have given too little information to understand how appropriate this is.
2.

how to correctly identify different users so that they do not overwrite each other
what kind of game is this? Each user has its own ID and they do not overwrite each other.
There is a session.gc_maxlifetime parameter , but it changes the lifetime for all sites on the server. If this option does not suit you, you can implement session cleaning yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question