Hey guys,
I'm pretty knew in the web paradigm, and my big problem so far has been the session variables. They got lost for any apparently reason , and i'm saying that because when i debug the variable gets fill before to pass to the other page, but when i check the other page the value is null.
do any of you guys have any pointer?
sincerely
Ben
ps merry christmas !Well not sure what actually happensin your code, though just wanted to let you know, a new session variable is created each time you make some sort of a spelling mistake.
for ex: session("MyLoginVar") and Session("MLoginVar") would be 2 variables giving you no error msges.
hey thanks, but believe me I checked that more than one time, and I actually have a code like this
private sub AddtoSession(byval name as string,item as object)
if not session(name) then session.remove(name)
session.add(name,item)
end sub
I know that was dumb suggestion, but anyways i said it, becoz its sometimes we tend to make some really silly mistakes. no offence :D
now what can coz the session varibles to get "destroyed"...maybe
1. U are calling session.abandon?
2. too long idle time between pages and so the session ends
3. pages moving between "different" applications
well just a few more guesses.
From my experience sessionstate in vb.net is a bit buggy.
Are you using frames ? Frames & session variables do not mix too well. Response.redirect also may sometimes cause a session to drop.
The session also only exists for a single browser instance, so if you are redirecting to a new browser instance then the session will get lost.
Do you have anymore explanation on what your code is doing ?
Everytime you rebuild your project / solution the proper dll files "change"
therefore session state is dead. Try it out for yourself open two browsers. In one compile your project and try then clicking something on your other browser open. You will notice that the session state has vanished. You can properly handle this via checking session state in the load event of your code, and redirect when necessary.
This is a common problem that I too faced when I first started.
Jon
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment