Solved

Session values lost when Response.Redirect method is called

Posted on 2009-04-08
5
2,917 Views
Last Modified: 2013-12-17
Hello,

I have moved my web site over from IE6 to IE8 and have noticed that session values are being lost. So I excluded the .config file from being scanned by the anti virus software i am using and have included the following in my .config file:
<sessionState mode="InProc" timeout="50000" cookieless="false">

Session values are now being lost when Response.Redirect method is called.
Any clues why this is occuring and how it can be solved?
0
Comment
Question by:WalterRautenbach
  • 3
  • 2
5 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 24095679
This is a common problem, check out:
http://weblogs.asp.net/bleroy/archive/2004/08/03/207486.aspx

that explains the problem in more detail, as well as the solution
0
 

Author Comment

by:WalterRautenbach
ID: 24122740
No, i am using the Response.Redirect("~/Default.aspx",false) but this does not help me. The website was working perfectly until i upgraded my explorer from IE6 to  IE8.
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 24135351
Are you're coockies enabled on the ie8-browser ?

Why won't my session variables stick?
http://classicasp.aspfaq.com/general/why-won-t-my-session-variables-stick.html
0
 

Author Comment

by:WalterRautenbach
ID: 24156393
Sorry, this does not help me. I have tested the same website in IE 6 and it works fine, but in IE 8, sessions that are set, are null when i Redirect.
0
 

Accepted Solution

by:
WalterRautenbach earned 0 total points
ID: 24157831
I clear out the page from the cache before redirected. I noticed that when coming back to the page, the page is not rebuilt, but just reloaded from the cache.
I also added this code:
<meta http-equiv="pragma" content="no-cache">. This solves my problem.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question