Jump to content
Xtreme .Net Talk

Cookie question


Recommended Posts

Guest adouglas
Posted

I'm working on an ASP.NET application. My site stores a couple of values in a couple of cookies, sets their expiry date to be Date.Now.Addhours(2), then redirects to another site. This other site then redirects back to my site. I then go to read the values from the cookies I wrote before redirecting, but they don't seem to be there. But if I then close the browser, open it again and go to my site, my original cookies are there again. So they're being stored on the client machine alright, but for some reason they can't be seen when I return from this other site.

 

Any ideas why this is happening and suggestions on how I can see my cookies when I get back from the other site without having to restart the browser?

 

If it makes a difference (although I don't see why it would), the other site I'm redirecting to is standard ASP, not ASP.NET.

Guest adouglas
Posted
Is there any way for me to tell if it's directing to a page on the server and not a cached page? I've set Response.Expires=-1500 which is what I used to do with the old ASP to make sure it would load a fresh version of the page every time. Is there something else I need to do in .NET to make sure it gets a fresh copy of the page each time?
  • 5 weeks later...
Posted

Try to add this in your form_load sub

' Don't cache the page

Response.CacheControl = "no-cache"

Response.AddHeader("Pragma", "no-cach")

Response.Expires = -1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...