Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Creating Persistent Cookie In Internet Explorer

 
sudipto shekhar
Ranch Hand
Posts: 826
Chrome Eclipse IDE Oracle
  • 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: 172
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Recompile...the program again!!!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64985
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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: 826
Chrome Eclipse IDE Oracle
  • 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: 20552
57
Chrome Eclipse IDE Java Windows
  • 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: 826
Chrome Eclipse IDE Oracle
  • 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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic