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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

caching a logging out

Status
Not open for further replies.

transparent

Programmer
Sep 15, 2001
333
GB
I have a page, index.asp which has a logout button. On pressing this button the browser redirects to logout.asp which contains the following code:


*****************************************************
<%option explicit%>
<%response.buffer = true%>
<%session.lcid=3081%>

<%
session(&quot;user_id&quot;)= null
session(&quot;users_name&quot;) = null
session(&quot;department_id&quot;) = null
session(&quot;department_name&quot;) = null

%>

<script>window.location.href=&quot;index.asp&quot;</script>
******************************************************

This should redirect to a different version of index.asp (due to null values of session variables). It doesn't the index page is just a cached version of the original index.asp. Whats going wrong??

Cheers
for any help
 
Why not just use <% response.redirect=&quot;index.asp&quot; %> -Phil
fillup07@hotmail.com
 
why don't you try killing the session altogether..

<%
Session.abondon
response.redirect &quot;index.asp&quot;
%>
 
Yes I suggest killing the session too. Do that - along with the ASP redirect (instead of Javascript) -Phil
fillup07@hotmail.com
 
Cheers for the help!

I seem to have problems using response.redirect as well.

Any ideas what may be causing it?
 
code? -Phil
fillup07@hotmail.com
If my post was helpful, please give me a star!
 
ok in order not to cache your webpage try putting these lines on the top of your asp pages
response.expires = -1
response.cache-control = &quot;Private&quot;

and kill all the Session by doing this
Session.abandon

Then if u want to redirect with javaScript try writeing your jScript code in a function

function goback() {
window.lovation = &quot;index.asp&quot;
}

then in the body tag call this function onLiad=&quot;goback()&quot;
also check if a user tried to enter your cached page use the if statement if session(&quot;id&quot;) = &quot;&quot; then response.redirect &quot;index.asp&quot;
hope it will help your problems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top