Re: Cookie Newbie

This WebDNA talk-list message is from

2002


It keeps the original formatting.
numero = 43526
interpreted = N
texte = Why couldn't you just set the cookie like this?[SETCOOKIE name=login&value=username &expires=Tuesday, 18-Sep-2007 23:59:59 GMT &path=/&domain=[GETMIMEHEADER HOST]]That way it adopts the correct domain for the machine it's currently sitting on...On 9/18/02 11:33 AM, Inkblot Media wrote:> Here is what I would do to make the code work on both areas without the need > to change after testing. > > In the win98 enviroment I would open the HOST file: > > (generally) C:\windows\system32\etc\drivers\hosts it maybe in the system > folder. I cannot recall. > > In this file you will see an example: > > 127.0.0.1 localhost > > you can set a line so it looks like this > > 127.0.0.1 localhost > 192.168.1.1 mydomain.com > > Replace the 192.168.1.1 with your IP address and also the mydomain.com to > the actual domain you are working on. > > What this will do is cause your computer to look locally when you use the > URL without the www. > > http://mydomain.com > > and to the live site when you use the www. > > http://www.mydomain.com > > Now on to the cookie. > > You will need to check to see if the cookie exist. > > [GETCOOKIE name=cookieName] > > If the cookie exist you show page. If the cookie does not exist you call the > loggin script. > > [GETCOOKIE name=cookieName] > > [showif [GETCOOKIE name=cookieName]=] > [include protect.inc] > [/showif] > > After they do the loggin and you test against the username/password and all > is ok you can set the cookie. > > [SETCOOKIE name=cookieName&value=OK&path=/&domain=mydomain.com] > [SETCOOKIE name=cookieName&value=OK&path=/&domain=www.mydomain.com] > > By not setting the expiration date the cookie is a session cookie. I also > set the cookie for both www and not, just incase. > > That should work, but a more simple way to do it (if you are passing the > cart from page to page) is to set a header in the cart to the username or > the persons name when logged in and check against it. This would also let > you welcome them by calling that header. > > [orderfile cart=[cart]] > [showif [header33]=] > [include protect.inc] > [/showif] > > [showif [header33]!] > Your page goes here. > [/showif] > > [/orderfile] > > I have a protect tag that does all the login stuff if you want it. Just let > me know.--------------------------------------------------------------------- Clint Davis Webmaster / Interactive Media Specialist Gray Loon Marketing Group, Inc. http://www.grayloon.com 204 Main Street | Evansville, IN 47708 | Phone:812-422-9999 --------------------------------------------------------------------- ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Cookie Newbie (Bob Minor 2002)
  2. Re: Cookie Newbie (Rob Marquardt 2002)
  3. Re: Cookie Newbie (Inkblot Media 2002)
  4. Re: Cookie Newbie (Clint Davis 2002)
  5. Re: Cookie Newbie (Dan Strong 2002)
  6. Re: Cookie Newbie (Dan Strong 2002)
  7. Re: Cookie Newbie (Inkblot Media 2002)
  8. Re: Cookie Newbie (Dan Strong 2002)
  9. Re: Cookie Newbie (Dan Strong 2002)
  10. Re: Cookie Newbie (Dan Strong 2002)
  11. Re: Cookie Newbie (Brian Fries 2002)
  12. Re: Cookie Newbie (Gyorgy Ordody 2002)
  13. Re: Cookie Newbie (Inkblot Media 2002)
  14. Re: Cookie Newbie (ROBERT MCPEAK 2002)
  15. Cookie Newbie (Dan Strong 2002)
Why couldn't you just set the cookie like this?[SETCOOKIE name=login&value=username &expires=Tuesday, 18-Sep-2007 23:59:59 GMT &path=/&domain=[GETMIMEHEADER HOST]]That way it adopts the correct domain for the machine it's currently sitting on...On 9/18/02 11:33 AM, Inkblot Media wrote:> Here is what I would do to make the code work on both areas without the need > to change after testing. > > In the win98 enviroment I would open the HOST file: > > (generally) C:\windows\system32\etc\drivers\hosts it maybe in the system > folder. I cannot recall. > > In this file you will see an example: > > 127.0.0.1 localhost > > you can set a line so it looks like this > > 127.0.0.1 localhost > 192.168.1.1 mydomain.com > > Replace the 192.168.1.1 with your IP address and also the mydomain.com to > the actual domain you are working on. > > What this will do is cause your computer to look locally when you use the > URL without the www. > > http://mydomain.com > > and to the live site when you use the www. > > http://www.mydomain.com > > Now on to the cookie. > > You will need to check to see if the cookie exist. > > [GETCOOKIE name=cookieName] > > If the cookie exist you show page. If the cookie does not exist you call the > loggin script. > > [GETCOOKIE name=cookieName] > > [showif [GETCOOKIE name=cookieName]=] > [include protect.inc] > [/showif] > > After they do the loggin and you test against the username/password and all > is ok you can set the cookie. > > [SETCOOKIE name=cookieName&value=OK&path=/&domain=mydomain.com] > [SETCOOKIE name=cookieName&value=OK&path=/&domain=www.mydomain.com] > > By not setting the expiration date the cookie is a session cookie. I also > set the cookie for both www and not, just incase. > > That should work, but a more simple way to do it (if you are passing the > cart from page to page) is to set a header in the cart to the username or > the persons name when logged in and check against it. This would also let > you welcome them by calling that header. > > [orderfile cart=[cart]] > [showif [header33]=] > [include protect.inc] > [/showif] > > [showif [header33]!] > Your page goes here. > [/showif] > > [/orderfile] > > I have a protect tag that does all the login stuff if you want it. Just let > me know.--------------------------------------------------------------------- Clint Davis Webmaster / Interactive Media Specialist Gray Loon Marketing Group, Inc. http://www.grayloon.com 204 Main Street | Evansville, IN 47708 | Phone:812-422-9999 --------------------------------------------------------------------- ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/ Clint Davis

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

NEWBIE ? help with link (1998) RE: WebCatalog2 for NT Beta Request (1997) WebDNA Intranet Edition public demo (2002) Resume Catalog ? (1997) color and size options (1997) RE: protect tag on NT (1997) Hiding URL ? (1998) international time (1997) with Link i need to (1997) PCS Frames (1997) For those of you not on the WebCatalog Beta... (1997) Grep and <> (2005) WebCat2b13MacPlugIn - [showif][search][/showif] (1997) DON'T use old cart file! (1997) Sorry I didn't pay attention-but ??? (1997) OT: CSS expert needed for a newbie question (2002) UPPERCASE (1997) Wanted: More Math Functions (or, Can You Solve This?) (1997) WebCat 2.1beta etc (1997) financial calculation (2000)