473,243 Members | 1,543 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,243 software developers and data experts.

Session behavior

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 try to isolate the problem.

I have a simple application that demonstrates my problem.
Page 1, step1: SaveSessionVariableButton will create a string value, show
it on screen, save it in a session variable and show the session ID on screen.
Page 1, step 2: RefreshDisplayButton will load the session variable and
display it on screen, it will also display the Session ID.
Page 1, step 3: hyperlink to Page 2 that is defined in the same project as
Page 1 where the session variable and session ID areloaded and shown on screen
Page 2, step 4: hyperlink to Page 1 where the session variable and session
ID are loaded and shown on screen.

When I debug run this from Visual Studio on PC #1 the results are:
Page 1, Step 1: Session ID and Variable string are shown on screen
Page 1, Step 2: Same variable string and session ID are shown on screen
Page 1, Step 3: Same variable string and session ID are shown on screen
Page 1, Step 4: Same variable string and session ID are shown on screen

Copy the code to Visual Studio on PC #2, then debug run it. The results are:
Page 1, Step 1: Session ID and Variable string are shown on screen
Page 1, Step 2: Null variable string and different session ID are shown
on screen
Page 1, Step 3: Null variable string and different session ID are shown
on screen
Page 1, Step 4: Null variable string and different session ID are shown
on screen
--
T Ralya, FoxPro & .NET developer, HMSA
Nov 19 '05 #1
4 1927
I can think of 2 possible causes that explain the different behaviour on pc2

- Sessions are mode possbile by a session cookie in the browser (this is
a safe cookie). Maybe the browser doesn't accept them which is odd but possible/configured
as such.
- Sessions are thrown away after a timeout of 20 minutes (default I think)
or when the application restarts.
Maybe your 2nd pc restarts after every page delivery (also odd but possible).

If you can't solve it post the code and/or give us an url to the page.

Let me know if you have any more questions..

Cheers,
Tom Pester
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 try to
isolate the problem.

I have a simple application that demonstrates my problem.
Page 1, step1: SaveSessionVariableButton will create a string
value, show
it on screen, save it in a session variable and show the session ID on
screen.
Page 1, step 2: RefreshDisplayButton will load the session variable
and
display it on screen, it will also display the Session ID.
Page 1, step 3: hyperlink to Page 2 that is defined in the same
project as
Page 1 where the session variable and session ID areloaded and shown
on screen
Page 2, step 4: hyperlink to Page 1 where the session variable and
session
ID are loaded and shown on screen.
When I debug run this from Visual Studio on PC #1 the results are:
Page 1, Step 1: Session ID and Variable string are shown on screen
Page 1, Step 2: Same variable string and session ID are shown on
screen
Page 1, Step 3: Same variable string and session ID are shown on
screen
Page 1, Step 4: Same variable string and session ID are shown on
screen
Copy the code to Visual Studio on PC #2, then debug run it. The
results are:
Page 1, Step 1: Session ID and Variable string are shown on screen
Page 1, Step 2: Null variable string and different session ID are
shown
on screen
Page 1, Step 3: Null variable string and different session ID are
shown
on screen
Page 1, Step 4: Null variable string and different session ID are
shown
on screen

Nov 19 '05 #2
I have the same ASP.NET code on three PCs, work, home, and public_server.
therefore whatever ASP.NET controls, it must be doing the same.

client: home, server: home yields new session id on each post back

client: home, server: public yields same session id on each post back and
session var is OK, therefore browser must be allowing cookies

client: work, server: work yeilds same session id on each post back and
session var is OK.

This leads me to the conclusion that the problem is in IIS 5.1 on my home
(windows XP) pc. But when I posted on the IIS discussion group, they told me
ASP.NET controls the session ID.

--
T Ralya, FoxPro & .NET developer, HMSA
"To********************@pandora.be" wrote:
I can think of 2 possible causes that explain the different behaviour on pc2

- Sessions are mode possbile by a session cookie in the browser (this is
a safe cookie). Maybe the browser doesn't accept them which is odd but possible/configured
as such.
- Sessions are thrown away after a timeout of 20 minutes (default I think)
or when the application restarts.
Maybe your 2nd pc restarts after every page delivery (also odd but possible).

If you can't solve it post the code and/or give us an url to the page.

Let me know if you have any more questions..

Cheers,
Tom Pester
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 try to
isolate the problem.

I have a simple application that demonstrates my problem.
Page 1, step1: SaveSessionVariableButton will create a string
value, show
it on screen, save it in a session variable and show the session ID on
screen.
Page 1, step 2: RefreshDisplayButton will load the session variable
and
display it on screen, it will also display the Session ID.
Page 1, step 3: hyperlink to Page 2 that is defined in the same
project as
Page 1 where the session variable and session ID areloaded and shown
on screen
Page 2, step 4: hyperlink to Page 1 where the session variable and
session
ID are loaded and shown on screen.
When I debug run this from Visual Studio on PC #1 the results are:
Page 1, Step 1: Session ID and Variable string are shown on screen
Page 1, Step 2: Same variable string and session ID are shown on
screen
Page 1, Step 3: Same variable string and session ID are shown on
screen
Page 1, Step 4: Same variable string and session ID are shown on
screen
Copy the code to Visual Studio on PC #2, then debug run it. The
results are:
Page 1, Step 1: Session ID and Variable string are shown on screen
Page 1, Step 2: Null variable string and different session ID are
shown
on screen
Page 1, Step 3: Null variable string and different session ID are
shown
on screen
Page 1, Step 4: Null variable string and different session ID are
shown
on screen


Nov 19 '05 #3
If you use the same browser but get different result I would say its a server
issue.

You can use http://www.blunck.info/iehttpheaders.html to see exactly what
you send and get back to a server.

Without being able to reproduce I can't help you further. Good luck!

Cheers,
Tom Pester
I have the same ASP.NET code on three PCs, work, home, and
public_server. therefore whatever ASP.NET controls, it must be doing
the same.

client: home, server: home yields new session id on each post back

client: home, server: public yields same session id on each post back
and session var is OK, therefore browser must be allowing cookies

client: work, server: work yeilds same session id on each post back
and session var is OK.

This leads me to the conclusion that the problem is in IIS 5.1 on my
home (windows XP) pc. But when I posted on the IIS discussion group,
they told me ASP.NET controls the session ID.

"To********************@pandora.be" wrote:
I can think of 2 possible causes that explain the different behaviour
on pc2

- Sessions are mode possbile by a session cookie in the browser (this
is
a safe cookie). Maybe the browser doesn't accept them which is odd
but possible/configured
as such.
- Sessions are thrown away after a timeout of 20 minutes (default I
think)
or when the application restarts.
Maybe your 2nd pc restarts after every page delivery (also odd but
possible).
If you can't solve it post the code and/or give us an url to the
page.

Let me know if you have any more questions..

Cheers,
Tom Pester
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 try to isolate the problem.

I have a simple application that demonstrates my problem.
Page 1, step1: SaveSessionVariableButton will create a string
value, show
it on screen, save it in a session variable and show the session ID
on
screen.
Page 1, step 2: RefreshDisplayButton will load the session variable
and
display it on screen, it will also display the Session ID.
Page 1, step 3: hyperlink to Page 2 that is defined in the same
project as
Page 1 where the session variable and session ID areloaded and shown
on screen
Page 2, step 4: hyperlink to Page 1 where the session variable and
session
ID are loaded and shown on screen.
When I debug run this from Visual Studio on PC #1 the results are:
Page 1, Step 1: Session ID and Variable string are shown on screen
Page 1, Step 2: Same variable string and session ID are shown on
screen
Page 1, Step 3: Same variable string and session ID are shown on
screen
Page 1, Step 4: Same variable string and session ID are shown on
screen
Copy the code to Visual Studio on PC #2, then debug run it. The
results are:
Page 1, Step 1: Session ID and Variable string are shown on screen
Page 1, Step 2: Null variable string and different session ID are
shown
on screen
Page 1, Step 3: Null variable string and different session ID are
shown
on screen
Page 1, Step 4: Null variable string and different session ID are
shown
on scree

Nov 19 '05 #4
WJ
T Ralya,

1. What is your web configuration for this particular project ? Is session
set in "InProc", "StateServer", and or "SQLServer" ?
2. Is Cookie accepted/allowed on your client ?

3. By default, ASP.Net generates a unique Session ID when an instance of
IE/Browser is created (I am using MS/IE as example). This is only true if
your client accepts "cookies". Otherwise, you have to set "CookieLess"
setting properly in your web server for the project.

4. If you meet all above conditions, the Session ID will remain the same and
unique until the user exits or closes the browser session.

BTW: IIS-5 and 6 are working fine as far as "Session" concerns. I have not
had any session state problem with them. I use them daily!

John

Nov 19 '05 #5

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

Similar topics

27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
5
by: Ronald | last post by:
Hi there! I have a website partly written in ASP in where a shoppingbasket is used. The products of the shoppingbasket are stored in the session-object. (We use IIS6 on Windows 2003). This was...
4
by: Kent Tegels | last post by:
Okay, so I know I'm doing two evil things: using Frames and storing stuff in Session. I'm a sinner and I'll repent after this project, I promise. But for now, I've got an interesting issue. ...
1
by: Johan Nedin | last post by:
Hello! I have a problem with SQLSession state on my ASP.NET pages. SQLSession state behaves very different from InProcess session state, which I think is very bad. I can understand some of...
4
by: Aidas Pasilis | last post by:
I'm saving some values to the Session state and get some strange results. To be short I'll write example code and standart behavior: Code Example:...
7
by: Victor | last post by:
I've got two domain names sharing the same IP address that use ASP VBScript If I set a session variable with domain 1, it is only available for domain 1 - this is correct? If I set an...
18
by: BillE | last post by:
When a user opens a new IE browser window using File-New-Window the integrity of an application which relies on session state is COMPLETELY undermined. Anyone who overlooks the fact that...
26
by: BillE | last post by:
Some ASP.NET applications use Session Variables extensively to maintain state. These should be re-written to use viewstate, hidden fields, querystring, etc. instead. This is because if a user...
25
by: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post by:
I tried: <sessionState timeout="1"> </sessionState> bounced IIS, and after 1 minute still had a session. ??? -- thanks - dave
8
by: Andrew Teece | last post by:
Hope someone can help. We are trying to deploy an ASP.Net 2.0 application to a 3-node webfarm. The application uses the ReportViewer control in local mode, hence we need session state. Because we...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...

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.