I did as above but didn't work
Main Topics
Browse All TopicsHi,
I have a Page "Main.asp" with 3 buttons on it. But1, But2, But3
when i clicked on the But1 a new page link in opened (its and HREF),
when i clicked on the But2 a new page link in opened (its also an HREF)
when I clicked on the But3 a new page link in opened (its an HREF)
All the three opened windows are different.
The thing is the user id are different for each one of the page opened when clicked on the button.
if i click on But1 a new page opens with its userid. and If I donot close the window and click back button to go to Main.asp and click But2 I am getting an error Access Denied. Because It assuming the same userid which opened the new page when clicked on But1. (the user can enter only from Main.asp choosing its appropiate Button)
If I close the Window , go back to "main.asp" and click on But2 it works fine but How do I make it work without closing the window.Just by clicking the Back button. Because My main.asp page is going to be kept opened always for users to select between But1 and But2 and But3 (ALL THREE ARE DIFFERENT USERS)
Also The important thing is I have do all the killing of the Session and Cookies in Main.asp only.
I cannot do any changes on the pages which are opened when clicked on Buttons.
I tried to clean the session and cookies on the page load of the Mai.asp so that when Back Button on the Browser is clicked
the main.asp is refreshed but it does not work.
Also I donot know the name of the Cookies, How do i kill all the cookies.
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You do it on the server side, don't you?
It is client side code and it works. However, I'm not sure you will be satisfied with the results.
On the server side you should use Session("username") = "";
As far as I understood if there is no username cookies set when HREF pages gets processed you assign new name, otherwise you assume name is already defined and try to work with it.
Probably it would correct to define some parameter of query string of HREFs in main.asp that will make them to reset username. You could use another cookier instead of query string parameter.
If i use the below code it is giving me error
Request object, ASP 0105 (0x80004005)
An array index is out of range.
/Menu/Main.asp, line 10
Response.Write (Response.Cookies.Count())
Session.Contents.RemoveAll
Session.Abandon()
Dim i
Dim cookieName 'As String
Dim limit 'As String
limit = Request.Cookies.Count -1
For i = 0 To limit
aCookie = Request.Cookies(i)
aCookie.Expires = DateTime.Now.AddDays(-1)
Response.Cookies.Add(aCook
Next
I'm not sure I understand what are you trying to do now, but this code from MSDN might help you for cookies iteration.
For Each strKey In Request.Cookies
Response.Write strKey & " = " & Request.Cookies(strKey) & "<BR>"
If Request.Cookies(strKey).Ha
For Each strSubKey In Request.Cookies(strKey)
Response.Write "->" & strKey & "(" & strSubKey & ") = " & _
Request.Cookies(strKey)(st
Next
End If
Next
Business Accounts
Answer for Membership
by: OMC2000Posted on 2004-05-06 at 08:50:34ID: 11006989
You could try this approach:
e.com/Web/ Web_Langua ges/JavaSc ript/ Q_201 04185.html
http://www.experts-exchang
<body onload="clearCookies()">
<script language="JavaScript">
function clearCookies()
{
var thecookie = document.cookie
cgroup = thecookie.split(";")
for (i=0;i<cgroup.length;i++) {
cgroup[i] = cgroup[i].split("=")
document.cookie = cgroup[i][0] + "=''"
}
}
</script>