.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

HTTPContext.Current.Session is NULL in SharePoint 2007 (MOSS)

Posted By:      Posted Date: September 23, 2010    Points: 0   Category :SharePoint

For some strange reason HTTPContext.Current.Session is null in SharePoint 2007 web application.

Session is enabled everywhere and used to work so its not a setup issue. Something got corrupted at some point either via patches or something...

Doing "Reset To Definition" fixes the issue, but I can't do that in production environment and what is reset to definition has to do with session being null?

Searching on the web found a post from someone having same exact issue:


I need to know how to FIX this w/o doing complete "Reset To Definition".

View Complete Post

More Related Resource Links

Users getting logged out because HttpContext.Current is null


We've  been trying to fix this one for a couple years, and I'm just out of ideas, so any help is really appreciated!

We've got a fairly large, complex web application that uses Forms Authentication to authenticate users.  Throughout the application we store and retrieve information about users in the Session object, and in some cases in cookies.  In a couple places we check for the existence of the context, and if it's null we send the user back to the login page to re-establish the session. 

Just a quick run-down of this web app: C#, .NET 3.5, IIS 6, ASP.NET State Service to manage session

As for the session timer, we use our own home-grown timer, which is basically a client-side timer, which is backed up by a check to the SQL database to see when their last activity was.  This seems to work well for us.  It's not perfect, but it allows us to notify the user before the session times out, and allows us to be certain we're not logging a user out before their 60 minutes of inactivity is up.

What's happening is that certain users are being logged out after just a few minutes.  We've eliminated the timer as a cause and believe what's happening is the HttpContext.Current is null, so the user is logged out.  We do not know why the HttpContext.Current is null, and I underst

MOSS 2007: Automate Web App Deployment with the SharePoint API


Learn how to automate custom SharePoint application deployments, use the SharePoint API, and avoid the hassle of custom site definitions.

E. Wilansky, P. Olszewski, and R. Sneddon

MSDN Magazine May 2008

Cannot locate Tsneu.xml to Configure SharePoint Treasure (Synonym) In MOSS 2007


Hi all,

I wanna follow this article -> http://www.codeproject.com/Articles/36203/How-to-Configure-SharePoint-Treasure-Synonym-In-MO.aspx?msg=3038555 

to figure SharePoint Treasure (Synonym) In MOSS 2007.


I created the SSP for searching file, and my SSP guid is 7xxxxxx-xx etc., but in my MOSS 2007 server,  

I have this folder -> "Drive:\Program Files\Microsoft Office Servers\12.0\Data",

but no I haven't "Drive:\Program Files\Microsoft Office Servers\12.0\Data\Applications\" folder, so I cannot locate Tsneu.xml as above article.


I can find "tsneu.xml" file in following 4 folders, I don't know which file I should modify... 


Chapter 8: Advanced SharePoint Programming, Part 1 (Expert WSS 3.0 and MOSS 2007 Programming)

Learn about web configuration modification via SharePoint object model and extending the STSADM command-line utility in this book excerpt.

Chapter 8: Advanced SharePoint Programming, Part 2 (Expert WSS 3.0 and MOSS 2007 Programming)

Learn about SharePoint feature receivers, developing custom timer jobs, feature dependencies, and feature stapling in this book excerpt.

HTTPContext.Current.Session losing the variable sporatically

I have noticed a strange behaviour in my ASP.net 2.0 application. I have some logic in my aspx page that accesses some Session variables fine, then accesses some app_code and most of the time the HTTPContext.Current.Session returns the variable back fine.  However, I have noticed that sometimes this Session returns null, like it has lost it's "pointer" to the current HTTPContext. Is this a known bug, has anyone seen something like this before?   Any help would be appreciated, thanks, Mark. 

HttpContext.Current is null

I have an intermittent issue where HttpContext.Current is null.  I do have aspNetCompatibilityEnabled="True".  I can duplicate it by restarting the webservice and make the request.  The first request has the HttpContext.Current set to null but subsequent requests have the proper HttpContext.  I've done some tracing and the messages are exactly the same. What else is weird is that the HttpContext is NOT null in my global.asax but by the time it hits my custom UsernamePasswordValidator, it is set to null.   Any ideas on what i'm doing wrong? HttpRequest from tracing: <HttpRequest> <Method>POST</Method> <QueryString></QueryString> <WebHeaders> <Cache-Control>no-cache</Cache-Control> <Connection>Keep-Alive</Connection> <Content-Length>799</Content-Length> <Content-Type>text/xml; charset=utf-8</Content-Type> <Accept>*/*</Accept> <Accept-Encoding>identity</Accept-Encoding> <Host>mydomain.com</Host> <User-Agent>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.2)</User-Agent> <SOAPAction>"http://tempuri.org/ICategoryService/GetAvailablePickList"</SOAPAction> </WebHeaders> </Htt

Best Way to Convert MOSS 2007 Site Templates to SharePoint 2010 Templates

Ok, I just treid to do something that I didn't really think would work, but now that I've seen it fail, I get to ask the question. Is there a best practice on converting site templates built for MOSS 2007 to SharePoint 2010. We have several projects that used the Visual Studio Extensions (v1.3) and the SharePoint Solution Generator to build custom site templates and the .wsp packages. I can add and deploy the solution packages using the STSADM tool, but when I try to create a sub-site based on that template, I get an Object Not Set to an Oject Reference Error. In case anyone is wondering, it works fine in MOSS 2007. I have not tried Visual Studio 2010 yet (it's downloading in the background). I'm just wondering if anyone has run into this and what they did to fix it. TIA, John.

Reg deployment of solution packages in SharePoint 2010 from MOSS 2007

Hi, Earlier we have developed some custom web parts,features and deployed into the site through solution package(wsp files) when customer was using MOSS 2007.Now customer is migrating all sites into SharePoint 2010.Now my query is can i use the same solution to deploy into the site through Central Admin of SharePoint 2010 or is there any seperate process for that? Thanks & Regards, Sudheer


Hello, everyone! Well, I made some researches to discover how can I use session variables in App_code. A lot of sites show me answer is use HttpContext.Current.Session. But I´m having following error: The name 'HttpContext' does not exist in the current context. What can I do?

MOSS 2007 upgrade to Sharepoint 2010 across domains

I recently did an upgrade at a customer site. I migrated their content successfully as well as their Mysites. Their MOSS farm was situated on a domain, let's say "domain 1". Due to a merger, their domain had to change to "Domain 2". The Sharepoint 2010  farm was set up on new domain. We now need to change the existing user logins from the upgraded content db to the new domain. domain1\user to Doamin2\user.  We considered a manual process, but it is simply not a viable option. Furthermore, the migrated mysites works fine, but the problem is, the users need to login with their old login details to view the content. Which is unacceptable. The mysite content now needs to be associated with the users on the new domain. Bear in mind that the users already have logins and permissions as per the previous configuration (domain1\user) I consideredd using the stsadm migrate user command, but that could also be laborious. The other concern is the SID associated to each login. I am not sure if the -ignoresidhistory switch will help, or if this command is even usable in SP 2010. I there possibly another, more effective method to accomplish these tasks, say a Powershell script or a magic wand?   Regards,   Warren  

Can we have both moss 2007 and sharepoint 2010 using a share SQL cluster?

Hello, I want to consolidate some server by using both SharePoint 2007 and SharePoint 2010 to use the same SQL 2008 R2 cluster. Is there any technical reason that should prevent to have both application to share same SQL server using different sql DB? Thanks

Upgrade from MOSS 2007 Trial to Sharepoint Server 2010

I have a client who setup MOSS 2007 Trial and are coming up on the expiration.  Instead of buying a key for MOSS 2007 they purchased Sharepoint 2010.  I'm having some problems upgrading because its the trial.  What are my options for upgrading/migrating over to Sharepoitn 2010?

MOSS 2007 to SharePoint Server 2010 Hybrid Upgrade Approach on Windows Server 2003 x64

There's some guidance circulating about upgrading to 2010 with a mix of In-Place and Database Attach upgrade methods. My Central Admin and SharePoint Web App are on a 64 bit server, but it's running on Windows server 2003 x64 and not on Windows Server 2008 or 2008 R2. SharePoint Team Blog says Server 2008 or 2008 R2 is required for SP2010. If I want to do the hybrid upgrade approach, is it possible to first upgrade the OS to Server 2008 R2 on the server where my Central Admin and SP Web App runs?  Or will this break MOSS 2007?

Sharepoint Worflow in MOSS 2007 and Visual studio EventHandlingScopeActivity in a while loop

Hi I'm building a sequencial approval Workflow  exactly the same than the one in the Sharepoint SDK collect feed back workflow. But the thing is that I put all the activities in a while activity and nothing is working any more. My EnableWorkflowModification bugs, and event if I remove it the onTaskUpdated event doesn,t fires. My Workflow look like this. WhileActivity   EventHandlingScopeActivity       Replicator                EnableWorkflowModification                       createTask                       whileLoop                             onTaskUpdated                       CompleteTask   If I remove the global while activity everything is fine. When I add it nothing works.   Can someone help. I dont understand why I cannot put a EventHandlingScopeActivity in while. Thabk youIch bin eine Beignet

How to export SharePoint site structure into another site on MOSS 2007 SP2

Hi All, Is it possible to export and import the site structure only without the content-just the tables/forms etc ? using only the builtin feature of MOSS 2007 ? if yes, can anyone share it here please ? Thanks, AWT/* Infrastructure Support Engineer */

Is there anyway to Sync SharePoint 2010 table to MOSS 2007 table?

Hello, I would like to know what can i use to sync a sharepoint 2010 table to a sharepoint 2007 table? Also could this be done by pulling the webservice for sharepoint 2007 site?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend