wframsay
asked on
Session/Cookies Not Persisting on Web Server
I have an intranet ASP.NET application that I am trying to deploy to a web server. Running the application on my development IIS server works fine, but on the web server, while the application runs, it does not save any cookie or session information. So, I created a test program to see if there was something wrong with my larger application, and the same behavior occurs, i.e., the devlopment server runs fine but web server still cannot save cookies (I didn't bother with session variables yet).
The code for the two pages in the test app is as follows:
The code for the two pages in the test app is as follows:
Set Cookies (default.aspx):
protected void Page_Load(object sender, EventArgs e)
{
HttpCookie myCookie = new HttpCookie("UserSettings");
myCookie["Font"] = "Arial";
myCookie["Color"] = "Blue";
Response.Cookies.Add(myCookie);
}
Read Cookie:
if (Request.Cookies["UserSettings"] != null)
{
if (Request.Cookies["UserSettings"]["Font"] != null)
{
Label1.Text += Request.Cookies["UserSettings"]["Font"];
}
}
ASKER
The test application is only running in a single domain (on our internal network). The example shown above is running in two separate ASPX pages on the same server.
We are using IIS 7, Windows Server 2008 R2 Standard, 64-bit.
The following Role Services are installed on the server:
Web Server
Common HTTP Features
Static Content
Default Document
Directory Browsing
HTTP Errors
Application Development
ASP.NET
.NET Extensibility
ISAPI Extensions
ISAPI Filters
Security
Windows Authentication
Request Filtering
Management Tools
IIS Management Console
We are using IIS 7, Windows Server 2008 R2 Standard, 64-bit.
The following Role Services are installed on the server:
Web Server
Common HTTP Features
Static Content
Default Document
Directory Browsing
HTTP Errors
Application Development
ASP.NET
.NET Extensibility
ISAPI Extensions
ISAPI Filters
Security
Windows Authentication
Request Filtering
Management Tools
IIS Management Console
ASKER
As an additional piece of evidence - the test app works with FireFox, but not with IE8 or IE7.
ASKER
Is this thing on?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I accepted my own solution as nobody answered after the first question on this item.
for example: yahoo.com is NOT same as www.yahoo.com
what version of IIS and Windows server are you using?