473,385 Members | 1,912 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,385 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 1933
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.