File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating Persistent Cookie In Internet Explorer

 
sudipto shekhar
Ranch Hand
Posts: 823
Chrome Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have the following java code to create a cookie with expiry time of 1 year.



But when I close the browser (IE), I see all the cookies being deleted.

Can anyone help me creating persistent cookies for IE.

Any help is appreciated.

 
Pranit Sonawane
Ranch Hand
Posts: 171
Java MySQL Database Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recompile...the program again!!!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pranit Sonawane wrote:Recompile...the program again!!!

Ummm, yeah.


A persistent cookie should be created with a path specified. It could just be "/" to indicate the entire domain.
 
sudipto shekhar
Ranch Hand
Posts: 823
Chrome Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Pranit Sonawane wrote:Recompile...the program again!!!

Ummm, yeah.


A persistent cookie should be created with a path specified. It could just be "/" to indicate the entire domain.


Thank you for the reply.

I agree that the path that is specified while adding the cookie in response is the location where the cookies are stored.

I modified the code as follows:



So, when the IE is re-opened, those cookies should be visible. But I do not see the same cookies again.

Any comments ?
 
Rob Spoor
Sheriff
Pie
Posts: 20381
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you perhaps tell Internet Explorer to actively block cookies?
 
sudipto shekhar
Ranch Hand
Posts: 823
Chrome Eclipse IDE Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Spoor wrote:Did you perhaps tell Internet Explorer to actively block cookies?


Using the plugin developer tools, I can see the cookies being added to the browser!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic