如何检测用户离开网站? [英] How to detect user leaving site?

查看:71
本文介绍了如何检测用户离开网站?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可以在没有客户端脚本的情况下完成吗?我认为会议

可能就是答案,但经过一些测试后发现,即使用户离开网站后,有时会发现

旧的会话数据,并且

回来了。但是,有一个想法。也许我可以访问用户

推荐人标题?

解决方案

sebastian schreef:


这可以在没有客户端脚本的情况下完成吗?我认为会议

可能就是答案,但经过一些测试后发现,即使用户离开网站后,有时会发现

旧的会话数据,并且

回来了。但是,有一个想法。也许我可以访问用户

推荐人头?



嗨Sebastian,


我认为如果没有JavaScript,你无法检测到这一点。

如果有人去其他地方,你的服务器没有得到通知。

你只能通过JavaScript试试。


推荐人:

我没看到Referer标题如何帮助你。

发送到下一个网站(如果发送的话)。


会话:

也没有去。

会话只不过是服务器上的一段数据

通过一个访问者链接到某个访问者PHPSESSID(通过cookie / url / form)。

我看不出他们如何帮助你。


所以底线,运气不好。

您需要JavaScript(或其他一些客户端技术,如JAVA

小程序)。


问候,

Erwin Moller


Erwin Moller写道:


sebastian schreef:


>这可以在没有客户端脚本的情况下完成吗?我认为会议可能是答案,但经过一些测试后发现,即使在用户离开网站并返回后,有时候会话数据仍然存在。但是,有一个想法。也许我可以访问用户
Referrer标题?



塞巴斯蒂安,

我认为如果没有JavaScript,你无法检测到这一点。

如果有人去其他地方,你的服务器没有得到通知。

你只能通过JavaScript试试。


推荐人:

我没看到Referer标题如何帮助你。

发送到下一个网站(如果发送的话)。


会话:

也没有去。

会话只不过是服务器上的一段数据

通过一个访问者链接到某个访问者PHPSESSID(通过cookie / url / form)。

我看不出他们如何帮助你。


所以底线,运气不好。

您需要JavaScript(或其他一些客户端技术,如JAVA

小程序)。



纠正我,如果我错了,但如果用户离开他的网站,然后返回

refer会指向另一个网站。因此,检测参考价值可以

可能有助于解决问题。


@Sebastian

请参考用户发送的信息,所以不可信任。您可以使用

来改善网站的功能,但不要将它用于任何

关键检查(如访问控制等)。


当用户输入网址

或在新标签页中打开新窗口时,也可以将参考设置为空(不确定)关于那个。)


最好的问候

Piotr N


Erwin Moller写道:


sebastian schreef:


>这可以在没有客户端脚本的情况下完成吗?我认为会议可能是答案,但经过一些测试后发现,即使在用户离开网站并返回后,有时候会话数据仍然存在。但是,有一个想法。也许我可以访问用户
Referrer标题?



塞巴斯蒂安,

我认为如果没有JavaScript,你无法检测到这一点。

如果有人去其他地方,你的服务器没有得到通知。

你只能通过JavaScript试试。


推荐人:

我没看到Referer标题如何帮助你。

发送到下一个网站(如果发送的话)。


会话:

也没有去。

会话只不过是服务器上的一段数据

通过一个访问者链接到某个访问者PHPSESSID(通过cookie / url / form)。

我看不出他们如何帮助你。


所以底线,运气不好。

您需要JavaScript(或其他一些客户端技术,如JAVA

小程序)。


问候,

Erwin Moller



甚至Javascript也不一定告诉你。关闭浏览器,例如,
将不会执行javascript。


-

======== ==========

删除x来自我的电子邮件地址

Jerry Stuckle

JDS计算机培训公司
js ******* @ attglobal.net

==================


Can this be done without client-side scripting? I thought sessions
might be the answer but after some testing found that sometimes the
old session data remained even after the user left the site and
returned. Just had an idea, though. Perhaps I could access the users
Referrer header?

解决方案

sebastian schreef:

Can this be done without client-side scripting? I thought sessions
might be the answer but after some testing found that sometimes the
old session data remained even after the user left the site and
returned. Just had an idea, though. Perhaps I could access the users
Referrer header?

Hi Sebastian,

I think you cannot detect this without JavaScript.
If somebody goes somewhere else, your server is not notified.
You can only try this via JavaScript.

Referer:
And I don''t see how the Referer header can help you out.
It is send to the next site (if send at all).

Session:
No go either.
A Session is nothing more than a piece of data on the server that is
linked to a certain visitor via a PHPSESSID (via cookie/url/form).
I don''t see how they can help you with this.

So bottomline, bad luck.
You need JavaScript (or some other clientside technology, like an JAVA
applet).

Regards,
Erwin Moller


Erwin Moller wrote:

sebastian schreef:

>Can this be done without client-side scripting? I thought sessions
might be the answer but after some testing found that sometimes the
old session data remained even after the user left the site and
returned. Just had an idea, though. Perhaps I could access the users
Referrer header?


Hi Sebastian,

I think you cannot detect this without JavaScript.
If somebody goes somewhere else, your server is not notified.
You can only try this via JavaScript.

Referer:
And I don''t see how the Referer header can help you out.
It is send to the next site (if send at all).

Session:
No go either.
A Session is nothing more than a piece of data on the server that is
linked to a certain visitor via a PHPSESSID (via cookie/url/form).
I don''t see how they can help you with this.

So bottomline, bad luck.
You need JavaScript (or some other clientside technology, like an JAVA
applet).

Correct me if I''m wrong, but if user left his site, and then returned
refer would point to the other site. So detecting refer value could
possibly help the problem.

@Sebastian
Refer it''s send by the user, so can''t be trusted. You can use it
to improve the functionality of the site, but don''t use it to any
critical checks (like access controll ect.).

It''s also possible, that refer will be empty, when user types in the url
or opens new window in ''new tab'' (not sure about that though).

best regards
Piotr N


Erwin Moller wrote:

sebastian schreef:

>Can this be done without client-side scripting? I thought sessions
might be the answer but after some testing found that sometimes the
old session data remained even after the user left the site and
returned. Just had an idea, though. Perhaps I could access the users
Referrer header?


Hi Sebastian,

I think you cannot detect this without JavaScript.
If somebody goes somewhere else, your server is not notified.
You can only try this via JavaScript.

Referer:
And I don''t see how the Referer header can help you out.
It is send to the next site (if send at all).

Session:
No go either.
A Session is nothing more than a piece of data on the server that is
linked to a certain visitor via a PHPSESSID (via cookie/url/form).
I don''t see how they can help you with this.

So bottomline, bad luck.
You need JavaScript (or some other clientside technology, like an JAVA
applet).

Regards,
Erwin Moller

And even Javascript doesn''t necessarily tell you. Closing the browser,
for instance, will not execute javascript.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


这篇关于如何检测用户离开网站?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆