By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,701 Members | 1,978 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,701 IT Pros & Developers. It's quick & easy.

disappearing session state variables

P: n/a
Hello there,

I've just encountered a strange problem with Session. In one particular
scenario it is cleared between pages but the scenario is so specific that I
am really, really startled. I've tried to look for similar situations in the
group archive and it seems that few people have observed similar behaviour.
None of them, however, got a clear explanation that would correspond to my
problem.

In my web application I put some information into the Session. On each
page I try to extract that information and if it is not there I just
redirect the user to the login page. It does work everywhere but in one
particular page where I have the <input type="file"> html control that
allows users to upload some data to the server. And now comes the problem:
the data that users upload is the XML file that is split to a bunch of
smaller files at the server side. If at least ONE of smaller files is
overwritten at the server side (because it could have been created before)
the data from the Session variable IS NOT removed. If ALL smaller files are
created as new files, the Session IS cleared out. in the debugger I can see
it clearly: the Session variable is there all the time and after executing
Response.Redirect it is gone at once.

I have found a dirty solution: instead of refreshing the view with
Response.Redirect i use Server.Transer in this one particular situation,
however I do not see any corresponence between Session state, vs creating
new files vs redirecting with Response.Redirect or Server.Transer. to me is
just like the car is not starting anymore because of my new slacks.

any comments on that would be appreciated.

thanks in advance
Wiktor Zychla
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I do not have a specific answer to your problem.
But I have had session variables disappear on me.
In all cases there was a page directive that limited the use of session
state to readonly or none.

I added those directives on the assumption that I could get a bit more
performance from those pages but then when the requirements changed and I
added code to use session the variables disappeared. Debugging always lead
back to the directives. But I would waste a few minutes figuring this out.
After being burned by this 2-3 times I ripped out the directives.
Now every page has full access to session variables.

I might add the directives back once the app is complete. But it is way too
much trouble for now when things keep changing.
--
Joe Fallon

"Wiktor Zychla" <us**@nospam.com.eu> wrote in message
news:uY**************@TK2MSFTNGP11.phx.gbl...
Hello there,

I've just encountered a strange problem with Session. In one particular
scenario it is cleared between pages but the scenario is so specific that
I am really, really startled. I've tried to look for similar situations in
the group archive and it seems that few people have observed similar
behaviour. None of them, however, got a clear explanation that would
correspond to my problem.

In my web application I put some information into the Session. On each
page I try to extract that information and if it is not there I just
redirect the user to the login page. It does work everywhere but in one
particular page where I have the <input type="file"> html control that
allows users to upload some data to the server. And now comes the problem:
the data that users upload is the XML file that is split to a bunch of
smaller files at the server side. If at least ONE of smaller files is
overwritten at the server side (because it could have been created before)
the data from the Session variable IS NOT removed. If ALL smaller files
are created as new files, the Session IS cleared out. in the debugger I
can see it clearly: the Session variable is there all the time and after
executing Response.Redirect it is gone at once.

I have found a dirty solution: instead of refreshing the view with
Response.Redirect i use Server.Transer in this one particular situation,
however I do not see any corresponence between Session state, vs creating
new files vs redirecting with Response.Redirect or Server.Transer. to me
is just like the car is not starting anymore because of my new slacks.

any comments on that would be appreciated.

thanks in advance
Wiktor Zychla

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.