Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Request info re Cookies
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Azaniah
Senior Member

United Kingdom
1004 Posts

Posted - 02 May 2002 :  06:19:34  Show Profile  Visit Azaniah's Homepage
Does anyone know or have an idiots guide to cookies.
Specifically in relation to snitz?

To be more precise, I think I need to know more about persistant and per-session cookies.

Cheers Az

-------
Eagles fly!, but weasels don't get sucked into jet engines.

Edited by - azaniah on 02 May 2002 07:29:35

Azaniah
Senior Member

United Kingdom
1004 Posts

Posted - 02 May 2002 :  09:29:16  Show Profile  Visit Azaniah's Homepage
Is the following correct.

If you do not state an expiry period a cookie will expire when the user closes the browser.

If you do state an expiry period such as


Response.Cookies(strUniqueID).expires = now + 365
Response.Cookies(strUniqueID)(test)=(strSize)


That expiry period only holds true for the page that you are on?

I'm a bit confused.

Cheers Az

-------
Eagles fly!, but weasels don't get sucked into jet engines.
Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 02 May 2002 :  10:14:38  Show Profile  Visit Gremlin's Homepage
Correct, no expiry date and the cookie is effectively just a temporary one and will be removed when the browser is closed.

AFAIK Cookies are set via paths rather than 'by page' so having (in your example) strUniqueID = "/" then the cookie is valid for the entire domain.

e.g If I set a cookie from www.daoc-halo.com with the strUniqueID = "/" then for every page my users vistis under that domain name, the browser will send the cookie to the server.

If I set the strUniqueId to "/forum/" then only when the user is browsing www.daoc-halo.com/forum/.... would the browser transmit the cookie.

Hope that clears it up a little.

www.daoc-halo.com
Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 02 May 2002 :  10:14:57  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
quote:

Is the following correct.

If you do not state an expiry period a cookie will expire when the user closes the browser.


Yup, that is correct....

quote:

If you do state an expiry period such as

Response.Cookies(strUniqueID).expires = now + 365
Response.Cookies(strUniqueID)(test)=(strSize)

That expiry period only holds true for the page that you are on?


The expiration period applies to all pages that are within that directory. If you want to handle one cookie for multiple directories, look at the code Snitz uses for it's cookies.

Hope that helps...

Dave Maxwell
--------------
Proud to be a "World Class" Knucklehead
Go to Top of Page

Azaniah
Senior Member

United Kingdom
1004 Posts

Posted - 02 May 2002 :  11:34:47  Show Profile  Visit Azaniah's Homepage
Hmm,

I'm still a bit confused.

If, as in this example, I have a couple of cookies that are written from the inc_functions.asp (called from the main forum directory), and then have another cookie from inc_something.asp which is in the include directory, that would need another expirory statement?

Sorry to be dim..

Cheers Az

-------
Eagles fly!, but weasels don't get sucked into jet engines.
Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 02 May 2002 :  13:43:37  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
Using the .Path portion allows you to specify the location of the cookie....

Here is the Snitz code I was talking about:

if strSetCookieToForum = 1 then
Response.Cookies(strUniqueID & "User").Path = strCookieURL
else
Response.Cookies(strUniqueID & "User").Path = "/"
end if


Dave Maxwell
--------------
Proud to be a "World Class" Knucklehead
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07