Solved

ASP.Net Web Service sessions

Posted on 2006-10-19
4
300 Views
Last Modified: 2010-04-16
I have an asp.net web service app that handles sessions which works fine in most cases, i.e the client can call up to 4 web service methods and data is remebered across the methods.

I am using .NET's built in session management.

The problem occurs when the web service is called by an ASP.Net web app with multple browsers making requests.

The web service app thinks the requests from the web app are all part of the same session even though they are from different browsers.

Is there any way to handle this?

Thanks

0
Comment
Question by:webprouk
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:SCDMETA
Comment Utility
This is not a solution but some questions to clarify the problem, are all browsers running on the same desktop? If so, how are you starting the browser instances?

a) If you launch two instances in Internet Explorer from a shortcut, and navigate to your app, each will get it's own sessionid.

b) If you open one instance of Internet Explorer, and the click File | New | Window, both instances of IE will get the same sessionid.

My bet is you are testing using method b).  Many people would argue that sharing the sessionID between multple browser instances spawned from a parent browser is a good thing.   Does the problem occur when you start each browser using method a, or start them on different machines?



0
 
LVL 1

Author Comment

by:webprouk
Comment Utility
thanks for your reply, but I have been testing using browsers on different machines.

these browsers connect to the web server which calls the web service. the web service thinks it is the same session because all the requests are coming from the web server.
 
0
 
LVL 6

Accepted Solution

by:
SCDMETA earned 500 total points
Comment Utility
Take a look at this link:
http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.httpwebclientprotocol.cookiecontainer.aspx

You can store the web serivce cookie used to access the web service, in the web application's session.

Browser 1 connects to the web application, you extract the stored web service cookie from the session, and call the web service.  You store the resulting cookie back in the session.

Browser 2 connect and the web application pull its web service cookie from the session, calls the web service, and store the results cookie back to the web app session.

This way each browser has it's own web service cookie.

I've never done this, but it looks possible.
0
 
LVL 1

Author Comment

by:webprouk
Comment Utility
Thanks a lot, that's just what i needed
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This is about my first experience with programming Arduino.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now