Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cookie Not Writing Issue

Status
Not open for further replies.

smurfer

Programmer
Jun 8, 2001
57
US
I have made a copy of a working asp application that has a login page that is tracking cookie information to sign in. In our production enviroment the cookies are written with no problem, however in my exact copy of the production site, I have copied the exact code, took a backup of the db and created a new db, changed the dsn to talk to the new test db, and the site runs fine. However after you login, the pages check for a cookie that is set, and the value returns a null since the cookie is never set. The code works fine on my prod server so I know it is not hte code preventing the cookie from being set, but in my duplicate environmen the cookies are not being written. Any ideas why this may be happening, I have never seen this before?? As a test I have made a copy on this same test server of another site I have and cookies are written for that site, so I think this eliminates any IIS setting to write cookies. And yes the browser is set to accept cookies as it works for many other sites. I have even added a new page as the default page that simply writes a basic cookie and it will not write the cookie?

any help or suggestions to pinpoint htis issue would be greatly appreciated.
 
Internet Explorer security settings doesn't allow cookies
in the client machine.
Right after creating the cookie you should read it and if it returns empty then it was not created and you should show a page asking for allowing cookies.
 
Using the Request.ServerVariables connection you can get client security settings much more easily.

However, if you are accessing both your prod and dev environments with the same client... Well, that's a head scratcher.
 
Yes I am using hte same lcient to access both. I have found a work aroudn although I am still curious why it did not work, but originally I had created the site using host header in IIS, and this is when it failed to write the cookies. I just changed it to the default web site on the server and it works fine, actaully writing cookies and funcitoning as it should. Strange thing is I have other sites as tests on this server using host header and they write cokies just fine. Very strange..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top