[PHP] Cookies Vs Sessions...?

2003-10-03 Thread Tristan . Pretty
Age old question...? Please don't flame if it is I currently remember my visitors on my site by setting a cookie thusly: setcookie(logged, yes); On each protected page, put an IF ($logged == yes) { //show page etc } else {//show login form etc } All good, works fine hooray for me...

Re: [PHP] Cookies Vs Sessions...?

2003-10-03 Thread Robert Cummings
On Fri, 2003-10-03 at 11:31, [EMAIL PROTECTED] wrote: Age old question...? Please don't flame if it is I currently remember my visitors on my site by setting a cookie thusly: setcookie(logged, yes); On each protected page, put an IF ($logged == yes) { //show page etc } else

Re: [PHP] Cookies Vs Sessions...?

2003-10-03 Thread Eugene Lee
On Fri, Oct 03, 2003 at 04:31:23PM +0100, [EMAIL PROTECTED] wrote: : : I currently remember my visitors on my site by setting a cookie thusly: : : setcookie(logged, yes); : : On each protected page, put an IF ($logged == yes) { //show page etc } : else {//show login form etc } You should use

Re: [PHP] Cookies Vs Sessions...?

2003-10-03 Thread Chris Shiflett
--- [EMAIL PROTECTED] wrote: 1. Can sessions work in the same way as my cookies? (Just remember a value to a variable, accross many page) Yes, they address the same challenge: persisting data. Also, please realize that sessions can use cookies for identification. One of the benefits of using

Re: [PHP] Cookies Vs Sessions...?

2003-10-03 Thread Chris Shiflett
--- Eugene Lee [EMAIL PROTECTED] wrote: setcookie(logged, yes); On each protected page, put an IF ($logged == yes) { //show page etc } else {//show login form etc } You should use $_COOKIE['logged'] instead. :-) While we're talking about should, you should also never trust what the

Re: [PHP] Cookies Vs Sessions...?

2003-10-03 Thread Eugene Lee
On Fri, Oct 03, 2003 at 08:57:17AM -0700, Chris Shiflett wrote: : : --- Eugene Lee [EMAIL PROTECTED] wrote: : : On each protected page, put an IF ($logged == yes) { //show page etc } : else {//show login form etc } : : You should use $_COOKIE['logged'] instead. :-) : : While we're