What are the developments to record the website user's exit?



  • I would like to record the time of the website user ' s release, I cannot find a precise and detailed answer, I have overshadowed many ways of taking the user ' s exit events, and each of them has had their own minus, i.e. not recording the exit, depending on the device, the OS and the exit events such as the browser, closing the deposit back on the page.

    Is there any more effective way to record the field exit? Especially Iphone



  • That might be a solution. Set up a table in which the user is registered and gives him a unique session code. Examples pstgresql

    CREATE TABLE hst_user_logins (
      session VARCHAR(32), -- уникальный код сессии
      login_datetime TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP, -- время входа
      logout_datetime TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP, -- время последнего действия (по сути время выхода)
      user_id BIGINT NOT NULL, -- указатель на таблицу пользователей
      ipaddr VARCHAR(15) NOT NULL, -- IP-адрес входа
      cookie VARCHAR(32) DEFAULT NULL::character varying, -- кука, на случай если время действия кода сессии истечет
      CONSTRAINT hst_user_logins_pkey PRIMARY KEY(id),
      CONSTRAINT hst_user_logins_session_key UNIQUE(session),
      CONSTRAINT hst_user_logins_fk FOREIGN KEY (user_id)
        REFERENCES spr_users(id)
        ON DELETE NO ACTION
        ON UPDATE NO ACTION
        NOT DEFERRABLE
    )
    WITH (oids = false);
    

    At the time of the user ' s authorisation, we keep the entry time, IP address, final time (=inlet time)

    In the LUBA, the user's action on the website is updating the field. logout_datetime♪ Thus, we will always have the time of his last act. If he's done something, then five minutes stupid and just shut down the browser or the deposit, we know that the last time he's done something then and since there's been an inaction on the website for us, we think it's the time to get out.



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2