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.
Code:
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.
Angshujit