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!

What's the problem with this cookie test?

Status
Not open for further replies.

rgao

Technical User
Feb 1, 2002
38
CA
Hi,
In my asp page I use session to store some information,so I want to write some codes to test the client side cookie,if the client side disable the cookie,it will show message asking them to enable cookie.But while I test it, it doesn't work well,eventhough I disable the cookie ,the session still work,(i already delete all cache files).it's weird,where could be the problem?
in login.asp:
<form .......action=&quot;test.asp&quot;>
...............
<inputtype=&quot;hidden&quot; name=&quot;firstid&quot; value=&quot;<%=session.sessionId %>&quot;>

in test.asp:
dim firstID
firstid=request.form(&quot;firstid&quot;)
if firstid=session.sessionId then
<lot's of code>
else
response.write&quot;Pls enable the cookie....&quot;
end if

Any help will be greatly appreciated.

 
One potential problem that I see is that if the cookies are off then your two sessionid's are going to be the same...blank. Also are you sure that you are disabling all your cookies. In some browsers you have to disable cookies that are perminent as well as cookies that are not. So you may not be disabling session cookies.

Hope that helps
Roj
 
Hi Roj
Thanks for your suggestion,I put &quot;if firstid<>&quot;&quot; then...&quot;
in the code ,it still failed.I think maybe I didn't disable all cookies .What I did is in browser(IE6) internet options under privacy tab block all cookies.Is there any other way to do disable all cookies?loking forward to hearing from you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top