473,513 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How does a web service distinguish session states?

In looking into Web Services, I noticed that they can maintain Session
variables. How does a web service distinguish different sessions? Does
this occur when the client creates an instance of the proxy class? If so,
then I am assuming that the client should create an instance of the service
proxy class for the lifetime that the client needs the web service. Is this
true?

Just a suggestion, but it seems like session variable management would be
much easier by just marking class fields with a SessionAttribute (or
something similar) if such an animal exists.

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
Nov 21 '05 #1
3 3193
Hi Ken,
In looking into Web Services, I noticed that they can maintain Session
variables. How does a web service distinguish different sessions?


On ASP.NET? The same way it does for ASP.NET webpages... cookies!

The rest of the mechanism works pretty much (both on the server and client
side) as the rest of the ASP.NET session mechanics. One thing to remember is
that, by default, the proxy classes generated won't have a cookie container
associated with them, and those won't be able to "remember" the session, so
you need to add that last part yourself if you want to enable it...

--
Tomas Restrepo
to****@mvps.org
Nov 21 '05 #2
Thanks for your reply. If you don't mind, I have a few other questions
regarding session state.

In general, are ASP.NET sessions separated by workstation or by browser
connections? I basically want to know whether an object that I store in a
session variable will be available on the next call to the web service. In
other words, when does the session state go away?

Regarding your statement...
One thing to remember is
that, by default, the proxy classes generated won't have a cookie container associated with them, and those won't be able to "remember" the session, so you need to add that last part yourself if you want to enable it...
What do you mean by "remember" the session, and what "last part" are you
referring to?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
-----------------------------------
"Tomas Restrepo (MVP)" <to****@mvps.org> wrote in message
news:uG**************@TK2MSFTNGP11.phx.gbl... Hi Ken,
In looking into Web Services, I noticed that they can maintain Session
variables. How does a web service distinguish different sessions?
On ASP.NET? The same way it does for ASP.NET webpages... cookies!

The rest of the mechanism works pretty much (both on the server and client
side) as the rest of the ASP.NET session mechanics. One thing to remember

is that, by default, the proxy classes generated won't have a cookie container associated with them, and those won't be able to "remember" the session, so you need to add that last part yourself if you want to enable it...

--
Tomas Restrepo
to****@mvps.org

Nov 21 '05 #3
Hi ken,
Thanks for your reply. If you don't mind, I have a few other questions
regarding session state.

In general, are ASP.NET sessions separated by workstation or by browser
connections? I basically want to know whether an object that I store in a
session variable will be available on the next call to the web service. In other words, when does the session state go away?


When exactly depends on a lot of factors, like the kind of session store you
use, etc. Normally, sessions might have an expiration time, which under
normal conditions should be the controlling factor.

--
Tomas Restrepo
to****@mvps.org

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5977
by: Nhi Lam | last post by:
Hi, I understand that there are 3 modes in which I can configure the SessionStateModule. What I need is an out of process Session State store with fail over support. The "SQL Server Mode" seems...
1
1331
by: Jonathan Amend | last post by:
I tried configuring my web application to use SQL Server for session states and I installed the SQL script provided by .NET to set up the databases and whatever goes with it but now my web...
0
1020
by: Mike | last post by:
Hi, We have an ASP.NET based website that can run either standalone or within our Win32 client via an embedded IE browser control. The site when running standalone in IE is fine, all works just...
0
1687
by: Matthieu Siggen | last post by:
Hello, I'm really confused about how to define services when concerning data management. I'm going to take an example to show where is my problem. If I'm developping an application with two...
4
1578
by: amit | last post by:
Hi guys!I am trying to write a program which will segregate some selected keywords from a given file.The source code is given alongwith #include<stdio.h> #include<string.h> char...
1
2168
by: Ronald S. Cook | last post by:
I was able to do my first Windows Communication Foundation test project and all worked well. But now I want to add a second class to my service. There is that Service.svc file that has only...
2
4416
by: Morgan Cheng | last post by:
By default, ThreadPool has 25 worker threads per CPU and 1000 IO threads for each process. I am wondering how CLR managed to allocate IO asynchronous tasks to IO thread and other asynchonous tasks...
0
1142
by: =?Utf-8?B?YWRhdmlzLmRldg==?= | last post by:
Currently, we have an ASP.NET 1.1 application where there exists several "sections". We are upgrading the application to .NET 2.0 and want to seperate these sections into individual VS projects...
2
4994
by: StanB | last post by:
I came across this weird problem: 1. Session state stops working after the app is deployed to another server because IE does not accept cookies. 2. It works if cookieless="true" in the...
0
7265
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7171
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7111
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5095
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3228
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.