Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Problems With Cookies

Author  Topic 

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2004-06-25 : 22:23:26
I am having some major problems with cookies and I can't figure out what is going on. I have two pages, one that writes the cookie and the other taht reads it. On the page that writes the cookie I have the code:

response.cookies("EagleDBZRPG")("How") = "Login Form"


and on the line that reads the cookie I have the code:

response.write "How: " & request.cookies("EagleDBZRPG")("How") & "<br />"
response.write "All Cookies" & request.servervariables("COOKIE")


If I look at my computer the cookie is on there but the page that reads it does not print out any of the cookie information. What could be going on?

--
For those with wings, fly to your dreams

Dearms are what are found at the end of reality, and your reality if what is found at the end of your dreams.

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-06-27 : 18:39:28

Are both pages a part of the same IIS application? Cookies aren't transferable across application boundaries AFAIK.

Have you tried just using a simple cookie:
Response.Cookies("MyNewCookie") = "MyValue"

then:

Response.Write Request.Cookies("MyNewCookie")

btw - There's a typo in your signature....

Go to Top of Page

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2004-06-27 : 23:53:35
Yes the pages are on the same IIS server, The code I gave does write the cookie to my computer but I can not get any other scripts on my site to read that cookie.

--
For those with wings, fly to your dreams

Dearms are what are found at the end of reality, and your reality if what is found at the end of your dreams.
Go to Top of Page

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-06-28 : 00:08:55

I assumed they're on the same server. My question was if both pages are in the same application - a different thing.

Go to Top of Page

sachinsamuel
Constraint Violating Yak Guru

383 Posts

Posted - 2004-06-28 : 00:26:26
What is the number of cookies you created in the application. Because, you cannnot create more than 20 cookies in a domain. In that case the iis server will kill anyone of the cookie.

Please also try by specifing the path of the cookies. This can also be a reason of cookie, not to work.

Response.Cookies("cookie_name").Path = "/"

Please let me know in any case.

Cheers
Sachin Samuel
Go to Top of Page

Eagle_f90
Constraint Violating Yak Guru

424 Posts

Posted - 2004-06-28 : 02:27:01
quote:
Originally posted by timmy


I assumed they're on the same server. My question was if both pages are in the same application - a different thing.


I don't know what you mean then, I don't run the server. I pay a web host for web space.


quote:
Originally posted by sachinsamuel

What is the number of cookies you created in the application.
Because, you cannnot create more than 20 cookies in a domain. In that case the iis server will kill anyone of the cookie.

Please also try by specifing the path of the cookies. This can also be a reason of cookie, not to work.

Response.Cookies("cookie_name").Path = "/"

Please let me know in any case.

Cheers
Sachin Samuel



I added the .path command and no change. Still can not be read, but it is been written. There is only one cookie being made, once I can get it working it will have 3 keys in it though.

--
For those with wings, fly to your dreams

Dearms are what are found at the end of reality, and your reality if what is found at the end of your dreams.
Go to Top of Page
   

- Advertisement -