Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Cookies from localhost Vs Url

I'm experimenting with ASP.NET for the first time, so no flames please...

I've built the start of a simple app that stores a user's Id in an encrypted cookie at login. The userId is then retrieved from the cookie at required stages in the app. for state purposes.

This all works fine when I'm running the project from localhost, but doesn't work when I start the project from the command line submitting the PC's name for localhost in the url.

Please put me out of my misery...

Samantha
Wednesday, December 22, 2004

So you going to:
  http://localhost/WebApp/SomePage.aspx
and it works, but you go to
  http://mymachine/WebApp/SomePage.aspx
and it doesn't?

Sounds like a browser configuration issue - if you use IE then go to Tools, Internet Options, Privacy and set the Privacy slider to Medium. Restart IE and try again.

Duncan Smart
Wednesday, December 22, 2004

I do have the strange problem.
Cookies and Sessions are not set when browsing at localhost.
http://localhost/myapp/visitor.aspx <-- didn't work
http://machinename/myapp/visitor.aspx <-- didn't work

On googling, I got to this page.
http://support.microsoft.com/kb/182891/EN-US/
It says that..

Cookie setting domain should be RFC compliant.
How can I make my local intranet as a RFC Compliant domain?

I have changed the machine name. Reset the IE cookie settings. Nothing works.

Vivek
Sunday, December 26, 2004

See also

http://support.microsoft.com/default.aspx?scid=kb;en-us;316112

http://support.microsoft.com/default.aspx?scid=kb;en-us;234142

Vivek
Sunday, December 26, 2004

Hi Folks,

Eventually found the problem...

Hosting machine name had an underscore - IIS doesn't like this for some reason... I didn't know this.

Thanks anyway...

Samantha
Friday, January 28, 2005

*  Recent Topics

*  Fog Creek Home