Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating cookie
Message
 
 
À
24/06/2004 13:00:28
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
00916866
Message ID:
00916934
Vues:
7
I tried closing the browser and opening it again, and to no avail. And I think I understand what you are saying and it makes sense to me. But the cookie still should be created, if my code is right.

I think my misunderstanding is that in my "foreach" look I should see _all_ cookies set on my PC/browser. And I know there are cookies there, since I see them in the IE temp folder. But the Request.Cookies collection only sees ASP session cookie. Why I don't understand.

Thank you for your reply and suggestions.


>I am not a cookie expert, just a novice with a guess. Since you are able to retrieve the session cookie, your browser must be set to allow cookies.
>
>When you set a cookie in the code behind, it sends the cookie to the requesting browser with its next served-up page. After that, when your client submits a page request to the server, the cookie is submitted with every page request to the associated domain.
>
>If you are setting and attempting to retrieve the cookie in a single server response, my guess would be that your cookie isn't considered part of the Request.Cookies collection until it has been set on your client in one response and sent back to the server with a subsequent page request. If you include a submit button in a form on the page to post the page back to itself, or include a JavaScripted onload event to refresh the page, does your cookie show up then?
>
>I think that ASP assumes that in code behind where you are setting a cookie, you still have the value associated with it available, in your case, cUserId. Cookies are designed to persist data between requests, so they probably don't work within a single request. The server probably doesn't add values to Request.Cookies that weren't actually part of the request.
>
>If you close down your browser, and hit the same server with a page that doesn't set the cookie in the code behind and the value still doesn't show up, I am wrong.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform