CommerceContext.Current.UserID is null!
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Commerce Server > Commerce Server General > CommerceContext.Current.UserID is null!




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    CommerceContext.Current.UserID is null!  
bp100a


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-27-04 06:37 PM

I have a site based largely on Retail2002.

I find that occasionally the CommerceContext.Current.UserID property is
NULL, so the app generates an exception.

This is happening for anonymous requests. I can see in
Application.cs:Application_BeginRequest() that everything *appears* to be
happening correctly. I cannot see where the UserID property is being set for
the this context.

/harry









[ Post a follow-up to this message ]



    RE: CommerceContext.Current.UserID is null!  
David Messner [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
02-27-04 07:36 PM

Do you have session state enabled for the site?  Are you trying to access
CommerceContext.Current.UserID from Session_OnStart by chance?

We have seen once case in the past where this was happening.
HttpContext.Current could be null in Session_Start under very specific
conditions that involve the session being locked and multiple requests
coming in at the same time for that one session.

The workaround is enclose Session_Start with an if(HttpContext.Current =
null).

Hope that solves it for you.
-djm
--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2004 Microsoft Corporation.  All rights
reserved.
--------------------
From: "bp100a" <someone@microsoft.com>
Subject: CommerceContext.Current.UserID is null!
Date: Fri, 27 Feb 2004 12:52:03 -0500
Lines: 15
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#DpIcoV$DHA.1036@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.commerceserver.general
NNTP-Posting-Host: ool-4350310e.dyn.optonline.net 67.80.49.14
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.commerceserver.general:13278
X-Tomcat-NG: microsoft.public.commerceserver.general

I have a site based largely on Retail2002.

I find that occasionally the CommerceContext.Current.UserID property is
NULL, so the app generates an exception.

This is happening for anonymous requests. I can see in
Application.cs:Application_BeginRequest() that everything *appears* to be
happening correctly. I cannot see where the UserID property is being set for
the this context.

/harry










[ Post a follow-up to this message ]



    Re: CommerceContext.Current.UserID is null!  
bp100a


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-04-04 09:36 PM

David,

Yes, I have sessions enabled. I have this problem on my workstation as I
test the site - yes I may have multiple browser windows open, but only one
is "active".

Another characteristic is the problem is "sporadic". Sometimes I get it
alot, other times not at all (for a while). I can't see anything that ties
that behavior together. I will looking into the items you mention.

/harry

"David Messner [MSFT]" <davidme@online.microsoft.com> wrote in message
news:xtDcLUW$DHA.2872@cpmsftngxa06.phx.gbl...
> Do you have session state enabled for the site?  Are you trying to access
> CommerceContext.Current.UserID from Session_OnStart by chance?
>
> We have seen once case in the past where this was happening.
> HttpContext.Current could be null in Session_Start under very specific
> conditions that involve the session being locked and multiple requests
> coming in at the same time for that one session.
>
> The workaround is enclose Session_Start with an if(HttpContext.Current =
> null).
>
> Hope that solves it for you.
> -djm
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use. © 2004 Microsoft Corporation.  All
rights
> reserved.
> --------------------
> From: "bp100a" <someone@microsoft.com>
> Subject: CommerceContext.Current.UserID is null!
> Date: Fri, 27 Feb 2004 12:52:03 -0500
> Lines: 15
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> Message-ID: <#DpIcoV$DHA.1036@TK2MSFTNGP10.phx.gbl>
> Newsgroups: microsoft.public.commerceserver.general
> NNTP-Posting-Host: ool-4350310e.dyn.optonline.net 67.80.49.14
> Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
> Xref: cpmsftngxa06.phx.gbl microsoft.public.commerceserver.general:13278
> X-Tomcat-NG: microsoft.public.commerceserver.general
>
> I have a site based largely on Retail2002.
>
> I find that occasionally the CommerceContext.Current.UserID property is
> NULL, so the app generates an exception.
>
> This is happening for anonymous requests. I can see in
> Application.cs:Application_BeginRequest() that everything *appears* to be
> happening correctly. I cannot see where the UserID property is being set
for
> the this context.
>
> /harry
>
>
>
>
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:13 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register