Re: [WebDNA] setcookie then redirect

This WebDNA talk-list message is from

2013


It keeps the original formatting.
numero = 110369
interpreted = N
texte = This is a multi-part message in MIME format. --------------030305010904040707090107 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit WebDNA 6.2 / CentOS 5.9 / Apache 2.2.3 This code works for me (always has): index.html -------------------- [setcookie name=loginCookie&value=0000000000&expires=[date %A, %d-%b-%Y][time %X]GMT] [redirect new-page.html] new-page.html ---------------------- [if [GETCOOKIE name=loginCookie]^0000000000] [then]it works[/then] [else]it doesn't work[/else] [/if] -Dan Strong New World Creative LLC http://www.NewWorldCreative.com On 5/3/2013 2:17 AM, Psi Prime Inc, Matthew A Perosi wrote: > Actually I'm not too sure of this. In my experience, when [redirect] > is found in a script it will trigger a redirect on the client side > without sending anything else down to the browser. > > I've not tested this behavior in 6.x or 7.x, but in years past I > always had to manually set the cookie values as variables at the same > time they are being set in the browser. In subsequent refreshes > (without the use of a redirect) the cookie information would be > available with [getcookie]. > > Remember, that cookie information is sent back to the server during > the initial request for the next page. They get set as part of the > header information during a 200 response as the next page is being > loaded. This is why you can't use [setcookie] at the beginning of your > script and then expect [getcookie] to return results later in the same > script. > > -Matt > > > On 5/2/2013 10:42 PM, Dan Strong wrote: >> I'm pretty sure that as long as you set the cookie before the >> redirect then the cookie will stick. >> -Dan Strong >> New World Creative LLC >> http://www.NewWorldCreative.com >> On 5/2/2013 7:39 PM, Steve Graham wrote: >>> Hello I have a quesion, can i setcookie then redirect to another >>> page? Will the cookie save in the browser or will redirect make the >>> cookie not save? Are there other conditions to make cookie not save? >>> --------------------------------------------------------- This >>> message is sent to you because you are subscribed to the mailing >>> list . To unsubscribe, E-mail to: archives: >>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >>> support@webdna.us >> >> --------------------------------------------------------- This >> message is sent to you because you are subscribed to the mailing list >> . To unsubscribe, E-mail to: archives: >> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >> support@webdna.us >> -- >> Matthew A Perosi >> Corporate Consultant >> Mobile Marketing Expert >> Senior Web Developer >> SEO Analyst & Educator >> matt@psiprime.com >> >> Psi Prime, Inc. >> 323 Union Blvd. >> Totowa, NJ 07512 >> >> Direct: 888.872.0274 >> Fax: 888.488.5924 >> >> http://www.perosi.com > --------------------------------------------------------- This message > is sent to you because you are subscribed to the mailing list . To > unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us --------------030305010904040707090107 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
WebDNA 6.2 / CentOS 5.9 / Apache 2.2.3

This code works for me (always has):

index.html
--------------------
[setcookie name=loginCookie&value=0000000000&expires=[date %A, %d-%b-%Y][time %X]GMT]
[redirect new-page.html]

new-page.html
----------------------
[if [GETCOOKIE name=loginCookie]^0000000000]
[then]it works[/then]
[else]it doesn't work[/else]
[/if]
-Dan StrongNew World Creative LLChttp://www.NewWorldCreative.com
On 5/3/2013 2:17 AM, Psi Prime Inc, Matthew A Perosi wrote:
Actually I'm not too sure of this.  In my experience, when [redirect] is found in a script it will trigger a redirect on the client side without sending anything else down to the browser.

I've not tested this behavior in 6.x or 7.x, but in years past I always had to manually set the cookie values as variables at the same time they are being set in the browser.  In subsequent refreshes (without the use of a redirect) the cookie information would be available with [getcookie].

Remember, that cookie information is sent back to the server during the initial request for the next page.  They get set as part of the header information during a 200 response as the next page is being loaded. This is why you can't use [setcookie] at the beginning of your script and then expect [getcookie] to return results later in the same script.

-Matt


On 5/2/2013 10:42 PM, Dan Strong wrote:
I'm pretty sure that as long as you set the cookie before the redirect then the cookie will stick.
-Dan StrongNew World Creative LLChttp://www.NewWorldCreative.com
On 5/2/2013 7:39 PM, Steve Graham wrote:
Hello I have a quesion, can i setcookie then redirect to another page? Will the cookie save in the browser or will redirect make the cookie not save?  Are there other conditions to make cookie not save?
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us
-- Matthew A PerosiCorporate ConsultantMobile Marketing ExpertSenior Web DeveloperSEO Analyst & Educatormatt@psiprime.comPsi Prime, Inc.323 Union Blvd.Totowa, NJ 07512Direct:  888.872.0274Fax:     888.488.5924http://www.perosi.com
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us
--------------030305010904040707090107-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] setcookie then redirect (Terry Wilson 2013)
  2. Re: [WebDNA] setcookie then redirect (Dan Strong 2013)
  3. Re: [WebDNA] setcookie then redirect (Donovan Brooke 2013)
  4. Re: [WebDNA] setcookie then redirect ("Psi Prime Inc, Matthew A Perosi " 2013)
  5. Re: [WebDNA] setcookie then redirect (Dan Strong 2013)
  6. [WebDNA] setcookie then redirect (Steve Graham 2013)
This is a multi-part message in MIME format. --------------030305010904040707090107 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit WebDNA 6.2 / CentOS 5.9 / Apache 2.2.3 This code works for me (always has): index.html -------------------- [setcookie name=loginCookie&value=0000000000&expires=[date %A, %d-%b-%Y][time %X]GMT] [redirect new-page.html] new-page.html ---------------------- [if [GETCOOKIE name=loginCookie]^0000000000] [then]it works[/then] [else]it doesn't work[/else] [/if] -Dan Strong New World Creative LLC http://www.NewWorldCreative.com On 5/3/2013 2:17 AM, Psi Prime Inc, Matthew A Perosi wrote: > Actually I'm not too sure of this. In my experience, when [redirect] > is found in a script it will trigger a redirect on the client side > without sending anything else down to the browser. > > I've not tested this behavior in 6.x or 7.x, but in years past I > always had to manually set the cookie values as variables at the same > time they are being set in the browser. In subsequent refreshes > (without the use of a redirect) the cookie information would be > available with [getcookie]. > > Remember, that cookie information is sent back to the server during > the initial request for the next page. They get set as part of the > header information during a 200 response as the next page is being > loaded. This is why you can't use [setcookie] at the beginning of your > script and then expect [getcookie] to return results later in the same > script. > > -Matt > > > On 5/2/2013 10:42 PM, Dan Strong wrote: >> I'm pretty sure that as long as you set the cookie before the >> redirect then the cookie will stick. >> -Dan Strong >> New World Creative LLC >> http://www.NewWorldCreative.com >> On 5/2/2013 7:39 PM, Steve Graham wrote: >>> Hello I have a quesion, can i setcookie then redirect to another >>> page? Will the cookie save in the browser or will redirect make the >>> cookie not save? Are there other conditions to make cookie not save? >>> --------------------------------------------------------- This >>> message is sent to you because you are subscribed to the mailing >>> list . To unsubscribe, E-mail to: archives: >>> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >>> support@webdna.us >> >> --------------------------------------------------------- This >> message is sent to you because you are subscribed to the mailing list >> . To unsubscribe, E-mail to: archives: >> http://mail.webdna.us/list/talk@webdna.us Bug Reporting: >> support@webdna.us >> -- >> Matthew A Perosi >> Corporate Consultant >> Mobile Marketing Expert >> Senior Web Developer >> SEO Analyst & Educator >> matt@psiprime.com >> >> Psi Prime, Inc. >> 323 Union Blvd. >> Totowa, NJ 07512 >> >> Direct: 888.872.0274 >> Fax: 888.488.5924 >> >> http://www.perosi.com > --------------------------------------------------------- This message > is sent to you because you are subscribed to the mailing list . To > unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us --------------030305010904040707090107 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
WebDNA 6.2 / CentOS 5.9 / Apache 2.2.3

This code works for me (always has):

index.html
--------------------
[setcookie name=loginCookie&value=0000000000&expires=[date %A, %d-%b-%Y][time %X]GMT]
[redirect new-page.html]

new-page.html
----------------------
[if [GETCOOKIE name=loginCookie]^0000000000]
[then]it works[/then]
[else]it doesn't work[/else]
[/if]
-Dan StrongNew World Creative LLChttp://www.NewWorldCreative.com
On 5/3/2013 2:17 AM, Psi Prime Inc, Matthew A Perosi wrote:
Actually I'm not too sure of this.  In my experience, when [redirect] is found in a script it will trigger a redirect on the client side without sending anything else down to the browser.

I've not tested this behavior in 6.x or 7.x, but in years past I always had to manually set the cookie values as variables at the same time they are being set in the browser.  In subsequent refreshes (without the use of a redirect) the cookie information would be available with [getcookie].

Remember, that cookie information is sent back to the server during the initial request for the next page.  They get set as part of the header information during a 200 response as the next page is being loaded. This is why you can't use [setcookie] at the beginning of your script and then expect [getcookie] to return results later in the same script.

-Matt


On 5/2/2013 10:42 PM, Dan Strong wrote:
I'm pretty sure that as long as you set the cookie before the redirect then the cookie will stick.
-Dan StrongNew World Creative LLChttp://www.NewWorldCreative.com
On 5/2/2013 7:39 PM, Steve Graham wrote:
Hello I have a quesion, can i setcookie then redirect to another page? Will the cookie save in the browser or will redirect make the cookie not save?  Are there other conditions to make cookie not save?
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us
-- Matthew A PerosiCorporate ConsultantMobile Marketing ExpertSenior Web DeveloperSEO Analyst & Educatormatt@psiprime.comPsi Prime, Inc.323 Union Blvd.Totowa, NJ 07512Direct:  888.872.0274Fax:     888.488.5924http://www.perosi.com
--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us
--------------030305010904040707090107-- Dan Strong

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:

Hideif not working? (2001) Site Builder & IE Mac (2004) Nested Loops and SHOWIFs (1997) [if] and [showif] - A solution (2002) WebCatalog NT beta 18 problem (1997) Webcat run amuk (2002) Problem with version 4 browsers (1998) WebCat2.0 [format thousands .0f] no go (1997) wrong input values? (1997) Upgrade Problem.... (1998) Help name our technology! (1997) What ports does Webcatalog use (2003) WebCat2 beta FTP site (1997) problems with 2 tags (1997) can WC render sites out? (1997) Getting total number of items ordered (1997) RE: Last desperate attempt (1998) frames & carts (1997) cart info (1998) Emailer problems (1998)