Click here to Skip to main content
15,920,217 members

Comments by Rohit Kukreti (Top 3 by date)

Rohit Kukreti 9-Oct-14 14:22pm View    
Forums are for helping to get directions and not for giving exact code. You need to modify to suit your need. I gave expiration time of 1 day but it can be changed for seconds, minutes, hours, etc.
Also, if you look at the code I gave you in the first place it would add (not append) new value to the cookie.
Rohit Kukreti 9-Oct-14 9:50am View    
If you look at the code, I have already given an expiry of 1 day. So you can set it the same way to whatever you want
myCookie.Expires = DateTime.Now.AddDays(1d);
Rohit Kukreti 8-Oct-14 4:28am View    
Hi, Just saw your comment. When you say you want cookie clear time, do you mean cookie expiration, Which means once the time elapses, cookie would be cleared and user needs to,login again. I have already entered the expiry logic
myCookie.Expires = DateTime.Now.AddDays(1d);