Don’t use Response.Cookies[string] to check if a cookie exists!(chwe.at)

submitted by cribecribe(50) 3 years, 4 months ago

If you use code like “if (Response.Cookies[“mycookie”] != null) { … }”, ASP.Net automatically generates a new cookie with the name “mycookie” in the background and overwrites your old cookie! Always use the Request.Cookies-Collection to read cookies!

1 comment |category: |Views: 14

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by johnsheehanjohnsheehan(4785) 3 years, 4 months ago 0

I didn't know anyone even thought reading cookies with Response was how you did it. Maybe more .NET devs should learn Classic ASP. You'd figure this out pretty quick.

Reply

information Login or create an account to comment on this story