DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Sun, 12 Aug 2007 13:44:48 -0400,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    SevDer am
          2    Peter Bromberg [C# MVP]
          3    (Steven Cheng[MSFT])
                 4    (Steven Cheng[MSFT])
          5    SevDer am
          6    (Steven Cheng[MSFT])


Website is not setting Session cookie for asp.net_sessionid   
Hi,

I've done some coding in my web application however right now for an unknown
reason my asp.net 2.0 site is not setting asp.net_sessionid cookie and as a
result, I am losing the session data in each page refresh or redirect.

I really do not have any coding against how the session works.
And I have not changed any setting in IIS.

I even compared the 2 code(old and new) bases and didn't see anything funny 
which will
cause this.

This truly drives me crazy right now.

Other notes: I've tried this on 3 different machines and it makes the same
behavior on all of them. (old code fine, new code bad)

But I want to repeat again, I am not doing anything related to actual
session

And a final note: After reviewing alot, I realized that before I use the 
session object at least once, application does not set "asp.net_sessionid" 
cookie.
When I set a dummy variable at least once, it works and sets 
"asp.net_sessionid" cookie. However this is still a problem as setting works 
after viewing the page for the first time.
As a result cookie is still not availble in the first load but valid 
afterwards.

Can someone tell me why my asp.net 2.0 app is not setting this cookie by 
default? Am I doing something wrong?

I have the following in my web.config
assemblies:
        <add assembly="Microsoft.VisualBasic, Version=8.0.0.0, 
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.DirectoryServices, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, 
PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, 
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="Microsoft.ReportViewer.Common, Version=8.0.0.0, 
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
        <add assembly="ADODB, Version=7.0.3300.0, Culture=neutral, 
PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="Microsoft.ReportViewer.ProcessingObjectModel, 
Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Data.OracleClient, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Windows.Forms, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="Microsoft.Build.Utilities, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="Microsoft.Build.Framework, Version=2.0.0.0, 
Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
http handler:
      <add path="Reserved.ReportViewerWebControl.axd" verb="*" 
type="Microsoft.Reporting.WebForms.HttpHandler, 
Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
Date:Sun, 12 Aug 2007 13:44:48 -0400   Author:  

RE: Website is not setting Session cookie for asp.net_sessionid   
I think this is by design - the Session doesn't "Bake" until a Session item 
has actually been set (in ASP.NET 2.0).
-- Peter
Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com



"SevDer" wrote:


> Hi,
> 
> I've done some coding in my web application however right now for an unknown
> reason my asp.net 2.0 site is not setting asp.net_sessionid cookie and as a
> result, I am losing the session data in each page refresh or redirect.
> 
> I really do not have any coding against how the session works.
> And I have not changed any setting in IIS.
> 
> I even compared the 2 code(old and new) bases and didn't see anything funny 
> which will
> cause this.
> 
> This truly drives me crazy right now.
> 
> Other notes: I've tried this on 3 different machines and it makes the same
> behavior on all of them. (old code fine, new code bad)
> 
> But I want to repeat again, I am not doing anything related to actual
> session
> 
> And a final note: After reviewing alot, I realized that before I use the 
> session object at least once, application does not set "asp.net_sessionid" 
> cookie.
> When I set a dummy variable at least once, it works and sets 
> "asp.net_sessionid" cookie. However this is still a problem as setting works 
> after viewing the page for the first time.
> As a result cookie is still not availble in the first load but valid 
> afterwards.
> 
> Can someone tell me why my asp.net 2.0 app is not setting this cookie by 
> default? Am I doing something wrong?
> 
> I have the following in my web.config
> assemblies:
>         <add assembly="Microsoft.VisualBasic, Version=8.0.0.0, 
> Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
>         <add assembly="System.DirectoryServices, Version=2.0.0.0, 
> Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
>         <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, 
> PublicKeyToken=B03F5F7F11D50A3A" />
>         <add assembly="System.Management, Version=2.0.0.0, Culture=neutral, 
> PublicKeyToken=B03F5F7F11D50A3A" />
>         <add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, 
> Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
>         <add assembly="Microsoft.ReportViewer.Common, Version=8.0.0.0, 
> Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
>         <add assembly="ADODB, Version=7.0.3300.0, Culture=neutral, 
> PublicKeyToken=B03F5F7F11D50A3A"/>
>         <add assembly="Microsoft.ReportViewer.ProcessingObjectModel, 
> Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
>         <add assembly="System.Data.OracleClient, Version=2.0.0.0, 
> Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
>         <add assembly="System.Windows.Forms, Version=2.0.0.0, 
> Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
>         <add assembly="Microsoft.Build.Utilities, Version=2.0.0.0, 
> Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
>         <add assembly="Microsoft.Build.Framework, Version=2.0.0.0, 
> Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
> http handler:
>       <add path="Reserved.ReportViewerWebControl.axd" verb="*" 
> type="Microsoft.Reporting.WebForms.HttpHandler, 
> Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, 
> PublicKeyToken=b03f5f7f11d50a3a" validate="false" />
> 
> 
> 
> 
Date:Sun, 12 Aug 2007 14:32:00 -0700   Author:  

RE: Website is not setting Session cookie for asp.net_sessionid   
Hi SevDer,

I've replied you in your former thread "Weird session lost and auto 
web.config", is this thread also developing from that one?

Based on your problem description, the problem you met seems due to the 
ASP.NET Session State's sessionID generate model. ASP.NET runtime will not 
allocate a fixed sessionID until the first time there is any data be stored 
into the SessionState collection. So if you haven't data stored in session, 
you'll find the sessionID changes in each request to the web application, I 
think this could also be the reason why you won't find a sessionid cookie.

Here is a ASP.NET session FAQ article that has explained this behavior:

#Understanding session state modes + FAQ
http://forums.asp.net/p/7504/7504.aspx

you can search for the following question title:

"Q: Why does the SessionID changes in every request?"

In addition, would you tell us some further info on your application logic 
and why will you rely on the sessionID/cookie at very begining(even there 
is no data in it)?Maybe we can look for some other means to workaround it.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

 

==================================================

Get notification to my posts through email? Please refer to 
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

 

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues 
where an initial response from the community or a Microsoft Support 
Engineer within 1 business day is acceptable. Please note that each follow 
up response may take approximately 2 business days as the support 
professional working with you may need further investigation to reach the 
most efficient resolution. The offering is not appropriate for situations 
that require urgent, real-time or phone-based interactions or complex 
project analysis and dump analysis issues. Issues of this nature are best 
handled working with a dedicated Microsoft Support Engineer by contacting 
Microsoft Customer Support Services (CSS) at 
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================
 	

This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Mon, 13 Aug 2007 10:08:21 GMT   Author:  

RE: Website is not setting Session cookie for asp.net_sessionid   
Hi SevDer,

How are you doing? Have you got any progress on this issue?  
Please feel free to post here if there is still anything we can help.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Wed, 15 Aug 2007 12:41:18 GMT   Author:  

Re: Website is not setting Session cookie for asp.net_sessionid   
Hi Steven,

Just to clarify the issues I'm having.
I've solved the issue by setting a dummy session variable even though I am 
not using it.

Now why do I need session when I don't directly use it?
Because I use a syncronized static hashtable where I access the active item 
for the session throught the sessionid. My reason for this is because there 
are threads working on active object in the hashtable for that session. This 
is why I need the session eventhough I don't use it directly.

I hope I made it clear...
SevDer

"Steven Cheng[MSFT]"  wrote in message 
news:nSu0amz3HHA.4100@TK2MSFTNGHUB02.phx.gbl...

> Hi SevDer,
>
> How are you doing? Have you got any progress on this issue?
> Please feel free to post here if there is still anything we can help.
>
> Sincerely,
>
> Steven Cheng
>
> Microsoft MSDN Online Support Lead
>
>
> This posting is provided "AS IS" with no warranties, and confers no 
> rights.
>
> 
Date:Tue, 21 Aug 2007 00:00:24 -0400   Author:  

Re: Website is not setting Session cookie for asp.net_sessionid   
Thanks for your followup SevDer,

Now I've got your detailed problem scenario. Yes, I agree that make the 
sessionID fixed is quite important in your design. 

Thanks again for your posting!

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Date:Tue, 21 Aug 2007 05:22:13 GMT   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us