Request.Cookies problem

Results 1 to 2 of 2

Thread: Request.Cookies problem

  1. #1
    Join Date
    Dec 1969

    Default Request.Cookies problem

    Very strange problem, its either a geniune issue or my heads not working<BR>I&#039;am trying to print all cookies passed to the client on a .ASP page I&#039;ve created throught Visual The page turns up blank(Page1), <BR>I copy and paste the same script in Page2 which was created through VisualInterdev (but I have opened it in VS.Net to paste the print cookie scrip). I run Page2 and cookies print out fine.<BR><BR>Both page2 and page 1 appear after the login screen and after the<BR>cookies have been directed to the clients computer through the login-check .asp pages.<BR><BR>Is this a known issue/bug?<BR>the script to print the cookies is<BR><BR>&#060;%<BR>for each item in Request.Cookies<BR> If Request.Cookies(item).HasKeys then<BR> For each ItemKey in Request.Cookies(item)<BR> Response.Write item & "-" & ItemKey & "==" & Request.Cookies(item)(ItemKey) & "<BR>"<BR> next<BR> <BR> Else<BR> Response.Write item & "==" & Request.Cookies(item)<BR> End If<BR>next<BR><BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default There could be various reasons...

    ...why this doesn&#039;t work, but I doubt it&#039;s a know bug that Request.Cookies doesn&#039;t work on page 1, but does work on page 2. It shouldn&#039;t have anything to do with Interdev either.<BR><BR>One possibility is that you&#039;re setting the cookies on page 1 and then try to read them on the same page - that WON&#039;T work. Cookies require a round-trip between the server and client, so it wouldn&#039;t work on page 1 but on page 2.<BR><BR>The other is that the rest of the code you have on page 1 is messing things up somehow. Have you tried putting a Response.Write "HELLO WORLD!&#060;br /&#062;" just before and just after the For loop to make sure the loop is actually running?<BR><BR>Other than that, we&#039;d need to see the code to be able to help.<BR><BR>Oliver.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts