Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 2nd, 2012, 04:54 AM
Authorized User
Join Date: Dec 2006
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default Facing problem with session variable in web service.

Hi all,
I have written a web service. Websites will consume this service from several pages of that site. Along with other tasks, my service has to track whether the user has entered in the website and visiting all those pages in one go. To trak that I have enabled the session for that web method and I have used a session variable for this.
if (Session["SERVICE_S_ID"] == null)  
Session["SERVICE_S_ID"] = HttpContext.Current.Session.SessionID;  
sessionid = Session["SERVICE_S_ID"].ToString();
Now I saved this sessionid value in the database to track whether the user is browsing different pages of the site in one go.
To test this, I have created a website with some pages and consume this service from all this page (in page_load). Now when I am browsing this site using IE, it is working fine and saving the same session id for borwsing all this pages. But surprisingly when I am browsing this pages using Firefox or Crome, it is saving different sessionid (though I am browsing the pages in one go). Which means for every page the Session["SERVICE_S_ID"] variable becomign null. I cannot understand why it is happening.
Can any one please help me on this.
Thanks in advance.

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with session variable prabhatsriva01 ASP.NET 2.0 Professional 3 May 10th, 2007 11:41 AM
Session Variable Problem caterpillar General .NET 0 August 17th, 2006 11:26 AM
Session Variable Problem kwilliams ASP.NET 2.0 Basics 0 June 12th, 2006 11:56 AM
Another Session Variable Problem jim.sullivan@telus.net Classic ASP Databases 1 August 1st, 2004 03:58 AM
Session Variable Problem leo_vinay Classic ASP Professional 1 October 1st, 2003 10:51 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.