473,396 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.ProcessingObjectM odel,
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" />

Aug 12 '07 #1
4 7275
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.ProcessingObjectM odel,
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" />

Aug 12 '07 #2
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.
Aug 15 '07 #3
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]" <st*****@online.microsoft.comwrote in message
news:nS**************@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.

Aug 21 '07 #4
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
Aug 21 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Jimmy Junatas | last post by:
When we open a window (using client-side jscript ie. window.open("/Site/Popup.aspx?...",...)) from Page1.aspx, the called page Popup.aspx does not have access to the Session variables present in...
1
by: Daniel Michaeloff | last post by:
Hi all, I have an application that when finished redirects to a non-ASP.NET app which is choking on a huge ASP.NET session cookie. The cookie "ASP.NET_SessionId" gets transmitted by the browser...
3
by: Alex Nitulescu | last post by:
Sorry, I'm really confused - I'm only at the middle of my book and already I can count 4 methods to store values. Yes, I know that cookies can not store much, but what is the difference between...
0
by: briand | last post by:
I have the following code in my base page to redirect to a session timeout page. override protected void OnInit(EventArgs e) { base.OnInit(e); //It appears from testing that the Request...
13
by: Alexander Widera | last post by:
hi, who has seen the follow problem or could help please? i visit a page .... i read a sesssion-var . ... everythink works...... i visit the page again..... error ... the sessionvar is null .... i...
7
by: Doug | last post by:
An ASP.NET session cookie set on "www.mydomain.com" can not be accessed on "search.mydomain.com"; hence, a new session and cookie are being created on every sub-domain. This is occuring because...
0
by: svilst | last post by:
How can I change the path of the cookie 'ASP.NET_SessionId'? The path is "/" and I'd like to set the path to particular virtual directory. The following approach does not work: protected void...
2
by: Vikas | last post by:
Hi I am using .Net v1.1 Is there any way to send the session cookie ASP.Net_SessionId Over SSL. Thanks in advance. Vikas
1
by: ALA | last post by:
Hi, does anybody know if it is possible to pass the SessionID with a web request by using a cookie so that the invoked page in the same domain can access the session objects of the current user?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.