Solved

ASP.Net Web Service sessions

Posted on 2006-10-19
4
303 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 500 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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 116
Tax Considerations for positive outcomes, outside the U.S. for IT Professionals 3 56
egit plugin on eclipse 8 102
add projects t working set in maven 2 44
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

726 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