Redian新闻
>
Re: 有没有办法在browser第一次访问的时候知道是不是支持cookie?
avatar
Re: 有没有办法在browser第一次访问的时候知道是不是支持cookie?# Java - 爪哇娇娃
o*e
1
nope.
but you can do a redirect for a new session,
see if the 2nd request carries the cookie,
then do another redirect to the original request.
avatar
d*r
2
多谢指教。
我也想到过这样做,不过觉得挺笨的。
有没有更好的解决方法呢?

有没有办法在browser第一次访问我的servlet的时候就知道该Browser是不是支持cookie?
而如果Browser支持cookie的话,上述";jsessionid=956BDE2350B3D6804965F328A3FBB63E
就会在第一次的页面输出中把所有的LINK都encode()上,就是带有:";jsessionid=956BD

【在 o***e 的大作中提到】
: nope.
: but you can do a redirect for a new session,
: see if the 2nd request carries the cookie,
: then do another redirect to the original request.

avatar
o*e
3
no, that's the way it is.

【在 d********r 的大作中提到】
: 多谢指教。
: 我也想到过这样做,不过觉得挺笨的。
: 有没有更好的解决方法呢?
:
: 有没有办法在browser第一次访问我的servlet的时候就知道该Browser是不是支持cookie?
: 而如果Browser支持cookie的话,上述";jsessionid=956BDE2350B3D6804965F328A3FBB63E
: 就会在第一次的页面输出中把所有的LINK都encode()上,就是带有:";jsessionid=956BD

avatar
m*t
4

But what's the point to start a new session on the *very first*
request? At this point the user has not done anything that needs
to be treated individually.
If you need to deal with a returning user from previous sessions,
then his browser must have cookie support, otherwise there is
no way for you to identify him as a returning user to begin with.

【在 d********r 的大作中提到】
: 多谢指教。
: 我也想到过这样做,不过觉得挺笨的。
: 有没有更好的解决方法呢?
:
: 有没有办法在browser第一次访问我的servlet的时候就知道该Browser是不是支持cookie?
: 而如果Browser支持cookie的话,上述";jsessionid=956BDE2350B3D6804965F328A3FBB63E
: 就会在第一次的页面输出中把所有的LINK都encode()上,就是带有:";jsessionid=956BD

avatar
c*g
5

if user bookmarked the url with sessionid, then he can identify him
as a returning user before the session expired.

【在 m******t 的大作中提到】
:
: But what's the point to start a new session on the *very first*
: request? At this point the user has not done anything that needs
: to be treated individually.
: If you need to deal with a returning user from previous sessions,
: then his browser must have cookie support, otherwise there is
: no way for you to identify him as a returning user to begin with.

avatar
o*e
6
some companies are obsessed with tracking usage pattern.

【在 m******t 的大作中提到】
:
: But what's the point to start a new session on the *very first*
: request? At this point the user has not done anything that needs
: to be treated individually.
: If you need to deal with a returning user from previous sessions,
: then his browser must have cookie support, otherwise there is
: no way for you to identify him as a returning user to begin with.

avatar
m*t
7

That's different. Before your session expires, your request is a
*returning* request, not the first one, regardless you came back with
a bookmark or not.
If an app wishes to recognize a returning user with a session id
that has already expired, then it would have to at least persist
this session id somewhere and *keep it forever* because it never
knows when the user is going to come back with that id.

【在 c**g 的大作中提到】
:
: if user bookmarked the url with sessionid, then he can identify him
: as a returning user before the session expired.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。