472,110 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,110 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 1850
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

27 posts views Thread by mrbog | last post: by
4 posts views Thread by Kent Tegels | last post: by
4 posts views Thread by Aidas Pasilis | last post: by
26 posts views Thread by BillE | last post: by
25 posts views Thread by =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= | last post: by
8 posts views Thread by Andrew Teece | last post: by

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.