Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
450 views
in Technique[技术] by (71.8m points)

java - Browser Cookie Persistent

My question is very simple, it may be asked before but the answers are not useful for me so i am asking it again.

How can i persist my cookie stored at browser , after is cleared manually ?

Scenario

I want to keep track of customer visit , so what i have been trying is at the very first request to my server i checked for any previous cookie stored , if it is found then i simply read the value and find relative information , if it is not found then i am creating a cookie and it to the response and so on.

Now, if Clients uses mozilla firefox browser and if client manually deletes all cookies ,the information is lost and according to above case every time the new cookie is generated which is meaning less.

I just test the same thing for SO , and i come to know that even if i delete all the history of browser (By pressing Ctrl + Shift + Del for Mozilla firefox v 20.0.1) , the SO can remember me.

So what technique SO is using for storing client information OR in the other words what should i do to persist my information at client side for most of the cases ?

During Google i found

Stack overflow Question

Java script cookie library

but still they have insufficient answers.

I also know that if someone re install OS then it is obvious that the information are lost and it is acceptable condition.

my goal is to preserve cookie information even if someone deletes it manually ?

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can't. And if you could it would be a very buggy browser.

What you can do is use flash, it has a different cookie space than the one of the browser, so usually by clearing the cookies in the browser the ones in flash are left untouched.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...