|
-
September 12th, 2001, 09:23 AM
#1
Cookies & Sessions question -
I have a login page for a site that sets a cookie if the user is authenticated, this much works, but I also have an include file called verify.asp that checks to see if the cookie exists and is valid each time a page is loaded. The only problem is if the cookie expires or is deleted, the verify file doesn't catch this? I have the include statement at the top of the page (before any HTML tags) and I gave the pages an .asp extension even though they are mainly HTML.
Is there any reason why this isn't working? I'm still learning how to use cookies and session objects, but I am otherwise fairly proficient with ASP yet I can't figure this one out. Any ideas?
Thanks,
AD
~goddess
[email protected]
"There are no stupid questions, but there are a lot of inquisitive idiots."
-
September 12th, 2001, 10:37 AM
#2
Re: Cookies & Sessions question -
Hi,
What I feel is you need not use a seperate ASP file using the include statement as this may not be called properly. Therefore what you do is add the code for checking the cookie at the begining of the page where u ar using the include statement.
for eg:
'-------------------
u_name=Request.Cookies("validusers")
if u_name="" then
this means that the cookie is not there..
in this case u write the code to reset the cookies again
for eg:
Response.Cookies("validusers")=give here the variable name that holds the username..
Hope this helps..
Please Reply after checking
best of luck
Aindril De
-
September 12th, 2001, 12:33 PM
#3
Re: Cookies & Sessions question -
I also got this one to work, but thank you for the kick start in the right direction!
~goddess
[email protected]
"There are no stupid questions, but there are a lot of inquisitive idiots."
-
September 13th, 2001, 07:05 AM
#4
Re: Cookies & Sessions question -
Thanx.. ho we help each other like this in future also..
Aindril De
-
September 14th, 2001, 10:06 AM
#5
Re: Cookies & Sessions question -
Sorry, I wanted to post the solution I found in hopes that it may help someone else someday...
'If (Request.Cookies("User") = "") then
' Response.Cookies("User").Expires = date
' Response.Cookies("Authenticated")=""
' session.Abandon()
'Response.Write"parent.location.replace'('http://mysite/errlogin.asp')"
'elseif (Request.Cookies("Authenticated") = "No") then
' Response.Cookies("Authenticated").Expires = date
' Response.Cookies("User") = ""
' Session.Abandon()
' Response.Write("parent.location.replace('http://mysite/errlogin.asp')")
'End If
~goddess
[email protected]
"There are no stupid questions, but there are a lot of inquisitive idiots."
-
September 15th, 2001, 08:58 AM
#6
Re: Cookies & Sessions question -
Thanx a lot I'll try this out and reply you..
take care
regards
Aindril De
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|