?
Solved

ASP.Net Web Service sessions

Posted on 2006-10-19
4
Medium Priority
?
306 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 6

Expert Comment

by:SCDMETA
ID: 17766745
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
ID: 17772127
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 2000 total points
ID: 17773013
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
ID: 17774258
Thanks a lot, that's just what i needed
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Make the most of your online learning experience.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

752 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