Solved

ASP.Net Web Service sessions

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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wordappend challenge 8 177
python question 5 76
Image decoding from Camera 3 86
draw a Christmas tree by using a nested loop? 26 62
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 an explanation of a simple data model to help parse a JSON feed
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

773 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