473,320 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Session variable expirement.

Hello, all.

Is there any case that session vaiables expire before the time-out?

Now, I'm developing the UI project that use the webservice project.
Ocationally I met the situation that I mentioned before.

Thanks.

Nov 19 '05 #1
5 1101
bluewind44 wrote:
Hello, all.

Is there any case that session vaiables expire before the time-out?

Now, I'm developing the UI project that use the webservice project.
Ocationally I met the situation that I mentioned before.

Thanks.


Session variables don't expire before the end of the session.
They can be *removed* before the end, or you have a different
session than you think.

You mention WebService. Webservices by default do *not* use
Session (for speed). So it you try to store something in Session in one
call and then use that in a next call, the value is gone (or even more
drastic: "Session" is null, so you get an error when you try to store anything)

To enable sessions for webservices:
1) use [WebMethod(EnableSession=true)] on the webservice method
2) create a CookieContainer (that's the name, I think) and add it to
the webservice proxy at the calling side (there is a property with a similar name).
Then use the same proxy or at least the same container for both calls.
Hans Kesting
Nov 19 '05 #2
Thanks for the reply.

Actually I don't use session varaiable on the webservice project.
I just use in a UI Projects and save it as a string variable.
Then I call my webservie project by using the string variable.

You mentioned about removement of session variable.
What cause removing the session variable ?

-----------------------
Kevin Lee

Nov 19 '05 #3
If, for some reason, the ASP.NET worker process crashes and gets recycles,
or the IIS worker process crashes and is recycled, you will lose all session
variables.

-Altaf[MVP]
--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com
"bluewind44" <bl********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
Thanks for the reply.

Actually I don't use session varaiable on the webservice project.
I just use in a UI Projects and save it as a string variable.
Then I call my webservie project by using the string variable.

You mentioned about removement of session variable.
What cause removing the session variable ?

-----------------------
Kevin Lee

Nov 19 '05 #4
Unless you are using State Server or SQL Server
to maintain state for your applications, of course.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"S.M. Altaf [MVP]" <sm*****@PLEASEDONTSPAMMEmsn.com> wrote in message
news:eM*************@TK2MSFTNGP10.phx.gbl...
If, for some reason, the ASP.NET worker process crashes and gets recycles, or the IIS
worker process crashes and is recycled, you will lose all session variables.

-Altaf[MVP]
--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com
"bluewind44" <bl********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
Thanks for the reply.

Actually I don't use session varaiable on the webservice project.
I just use in a UI Projects and save it as a string variable.
Then I call my webservie project by using the string variable.

You mentioned about removement of session variable.
What cause removing the session variable ?

-----------------------
Kevin Lee


Nov 19 '05 #5
Thanks really for all replies. ^_^

Nov 19 '05 #6

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

Similar topics

11
by: doltharz | last post by:
Please Help me i'm doing something i though was to be REALLY EASY but it drives me crazy The complete code is at the end of the email (i mean newsgroup article), i always use Option...
1
by: Ann Leland | last post by:
I have been using session variables to pass a user name from one ASP page to another inside framesets for 9 months and it stopped working this week. I have made no code changes but there was a...
2
by: Eric | last post by:
Hi, I've a problem with trying to retrieve a session variable in an include file. Basically, the main asp creates a session variable: <% Session("var1") = "Hello" %> And then when I click...
4
by: VB Programmer | last post by:
If I have a variable I want to share in my application what is the difference between just declaring a variable (Dim strMyVar as String) and using a session variable (Session("strMyVar"))? When...
9
by: Greg Linwood | last post by:
I'm having difficulty understanding Session state in ASP.Net. It's almost embarrassing asking this as I've been using ASP since it was first released & it really shouldn't be this hard to use -...
4
by: T Ralya | last post by:
I am told that ASP.NET controls the session ID and session variables, but that does not fit my symptoms. I am posting here as directed. I'm hoping that someone can at least recommend something to...
3
by: Alan Wang | last post by:
Hi there, Once my application gets complicated and complicated. I found it's really hard to keep track of Session value I am using in my asp.net application. I am just wondering if anyone have...
4
by: Don Miller | last post by:
I am using a Session variable to hold a class object between ASP.NET pages (in VB). In my constructor I check to see if the Session variable exists, and if it doesn't, I create one and populate it...
17
by: Control Freq | last post by:
Hi, Not sure if this is the right NG for this, but, is there a convention for the variable names of a Session variable? I am using .NET 2.0 in C#. I am new to all this .NET stuff, So, any...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.