Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE 7 losing session variables

Status
Not open for further replies.

TheOnlyBeth

Programmer
Jun 15, 2008
5
US
Hi -

I am losing my session variables only on one page of my app. It's written in ASP.NET 2.0/VB. I tracked it down to happening during the sub:

Protected Overrides Sub Finalize()
MyBase.Finalize()
End Sub

{I placed a msgbox before and after with the session variables. The variables appear before the MyBase.Finalize() but disappear after it.}

I've created at least 7 other pages against the same master page, using the same basic format. They all work perfectly. It is only this one page. All of the other pages have the same Sub Finalize() with the same code..but they are not having that problem.

Just in case there was some sort of wierd invisible code on the page, I recreated it...still having the issue.

There are no Session.Clear or any other code that clears the
sessions. Also the Session variables are not being reset with any new values.

I can flip from one of the other pages to another and even to this one without losing any of the values. It is only this page that does it. Basically I am keeping the security group ID in a session variable and implementing page level security. So when the sessions are cleared, the group ID is cleared and the page automatically defaults to the login page.

I've searched Google, google groups, 4GuysFrom Rolla and a dozen other places with no answer to this problem.

This is not a timeout issue as it happens instantaneously with no delay.

I go into the page with the variables, immediately click either the menu or a button to leave the page and 'boom'...the variables are gone. It even happens when I select the back button on my browser.

The strange thing it...it doesn't happen on a Safari browser. On IE only that page loses the session variables. In Opera ALL the pages lose their session variables. It also works perfectly in FireFox.

I'm desperate for help...anyone?

Thanks,

Beth
 
have you stepped through your code make sure the session is not cleared? since the behavior is inconsistent across browsers it may be a cookie problem.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Yes, I have cookiees enabled in IE. Otherwise the other pages wouldn't work.

Also I did step through my code as noted...that's how I found that my sessions are lost after the MyBase.Finalize() call in the Sub {webform name}_Finalize(). It's the call that is called on every webform and automatically created when the webform is created. There is no additional code in that sub aside from what is automatically placed there.

It is lost only on this one page and only in IE7 and Opera.

I checked on the internet some more and found that there have been reports of IE 7 sporadically losing session variables because it 'forgets' what cookiees it is looking at. But no one seems to have posted a solution to that problem.

I'm hoping to find it from someone here.

Thanks,

Beth
 
You say that it is only lost in that one page. What happens if you copy that page to a test harness? Can you replicate the problem?

[!]
-------------------------------------------------------

Mark,

Join me at the new IT Community of the 21st Century: [!][URL unfurl="true"]http://lessthandot.com[/!][/url]

[/!]
 
Do you have a response.redirect on that page? That could explain why you're losing your session...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top