I have a site usings ASP.NET 2.0 and forms authentication. The site works
fine from my development pc but when I publish the website to our
development web server, the session id gets lost right after I've
authenticated and then redirect them to a protected content page.

In my Login page I verify the userid and password, then perform the
following if the credentials are valid:

FormsAuthentication.SetAuthCookie(Login1.UserName.ToString(), false);
Response.Redirect("~/MyDeals/Home.aspx");

Home.aspx is only acessible to authenticated users.

After the forms authentication cookie is created, an ASP.NET_SessionId
cookie is also created, then as soon as the response redirect happens, the
ASP.NET_SessionId goes away and I get sent back to the login page.

Here's a catch: I published the exact code to our production server and it
worked perfectly, so I'm guessing it must be some setting on the server or
in IIS that's causing the behavior.

Does anyone have an idea? I've tried everything I can think of.

url:http://www.ureader.com/gp/1522-1.aspx

Re: ASP.NET_SessionId gets lost. by Bob

Bob
Wed Mar 05 13:01:52 CST 2008

Merlin wrote:
> I have a site usings ASP.NET 2.0

There was no way for you to know it (except maybe by browsing through
some of the previous questions before posting yours - always a
recommended practice), but this is a classic asp newsgroup. ASP.Net is
a different technology from classic ASP. While you may be lucky enough
to find a dotnet-savvy person here who can answer your question, you
can eliminate the luck factor by posting your question to a newsgroup
where the dotnet-savvy people hang out. I suggest
microsoft.public.dotnet.framework.aspnet.
There are also forums at www.asp.net where you can find a lot of people
to help you.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.