Cookie Expires works in one instance, not another

A

Alex Kail

I have a site that you can only gain access to if you are logged in.
My sign in screen asks for your email address and password. If all
checks out, I write out information to a cookie (Cookie 1).

Some people on the site, myself included, are moderators of the site.
Moderator functionality is all over the site, so I created a toggle
button that will make the site pages look like everyone elses, with
the exception of this toggle button. The toggle uses a cookie,
basically the same code except the data being placed in the cookie is
different. (Cookie 2)

Cookie 1 code:
Response.Cookies("Member")("ID") =
CStr(rsLogin.Fields("Member_ID").Value)
Response.Cookies("Member").Expires = DateAdd("d", 365, Date)

Cookie 2 code:
Response.Cookies("Moderator")("Mode") = "ON"
Response.Cookies("Moderator").Expires = DateAdd("d", 365, Date)

As you can see, not much difference between the two, but the second
works fine. I have tried placing the Expires code ABOVE and BELOW, but
that doesn't work.

Any suggestions, please?
 
A

Alex Kail

It might have helped if I finished my post. The first cookie is acting
like a cokkie with no expiration date set (ie - it is lost when the
browser session is closed). I can get logged in OK, obviously, but
want the cookie to be preserved after the browser is closed.

Help, anyone.

Alex Kail
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top