[PHP] Re: Cookies in non-frame sites

2006-02-26 Thread Bogdan Ribic
You can also use output buffering, write cookies from anywhere, and at 
the end of execution buffers will auto-flush.


[EMAIL PROTECTED] wrote:

Hello,

Most sites today seems to be based on this style:

include(top);
include(current_page);
include(bottom);

If one wants to set cookies from current_page, how should that be handled with 
as clean source as possible?
Before I had the top and bottom output as functions that are called from each 
page, so I can call header stuff before it's executed. But it's not a very good 
looking approach.


--

   Open source PHP code generator for DB operations
   http://sourceforge.net/projects/bfrcg/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Cookies

2005-02-24 Thread N Deepak
William Stokes wrote:
Hello,
If I send a session cookie to browser where it is stored in WinXP? Or is it 
stored as a separate file at all. I know that the script sends the cookie 
but I can't find it in the client computer harddrive.

I am testing with Opera, IE6 and Firefox.
This is not dependent on the OS, but the browser.  IE stores in 
%WINDIR%\Cookies.  Netscape stores in a Cookies subdirectory under 
C:\Program Files\Netscape\User\...

--Deepak
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: cookies under php 4.06

2003-09-04 Thread Chris Kranz

setcookie(UserName, $HTTP_POST_VARS['UserName'], time()+(60*10), /,
 $HTTP_SERVER_VARS['SERVER_NAME']);
setcookie(Password, $password, time()+(60*10), /,
 $HTTP_SERVER_VARS['SERVER_NAME']);
print login - set cookie;


sorry for kinda answering my own post... but anyway...

setcookie(UserName, $HTTP_POST_VARS['UserName']);
setcookie(Password, $password);

solves my problem, although means i can't have a time limit on my cookies i
guess... but can set a time limit with another cookie...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: cookies under php 4.06

2003-09-04 Thread Comex
 sorry for kinda answering my own post... but anyway...
Or you could use header()..
http://wp.netscape.com/newsref/std/cookie_spec.html

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: cookies under php 4.06

2003-09-04 Thread Jennifer Goodie
 setcookie(UserName, $HTTP_POST_VARS['UserName'],
 time()+(60*10), /,
  $HTTP_SERVER_VARS['SERVER_NAME']);
 setcookie(Password, $password, time()+(60*10), /,
  $HTTP_SERVER_VARS['SERVER_NAME']);
 print login - set cookie;


 sorry for kinda answering my own post... but anyway...

 setcookie(UserName, $HTTP_POST_VARS['UserName']);
 setcookie(Password, $password);

 solves my problem, although means i can't have a time limit on my
 cookies i
 guess... but can set a time limit with another cookie...

1.) I would not store the user's password in a cookie.

2.) As far as I know, set_cookie() has worked the same since PHP3, so your
problem is something else, not the PHP version.  Are you sure
$HTTP_SERVER_VARS['SERVER_NAME'] is the same as what's in the location bar
in your browser.  If the server name is set up as www.domain.com but the
user is just at http://domain.com the cookie won't set.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: cookies and redirection

2003-08-15 Thread Joaco
Ok, I have changed my code so the headers are sent as:

header(HTTP/1.0 302 Redirect);
header(Location: index2.php);
header(Set-Cookie: USER_COOKIE=$sUser);

I have changed the file name to nph-unsecure.php

It successfully sends me to the index2.php page, but no cookie... any ideas
  Joaco [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
  I have a small problem was wondering if anyone out there knew anyhting about
  this. I set a cookie in my code and then redirect the user using a header
  function. When I do this, my cookie is not created. If i remove the header
  function, then it is. Is there a way around this?



[PHP] Re: cookies in asp

2003-07-24 Thread Baroiller Pierre-Emmanuel
If it's a real cookie, you can get it with php into the cookie vars..
If it's an asp session, forget it... 
  Carlos Castillo [EMAIL PROTECTED] a écrit dans le message de news:[EMAIL 
PROTECTED]
  HI,

   

  I have the following problem, i have a website with php and asp files, in one asp 
file i create some cookie that i need to access on another php file.do you have 
any idea.???

   

  Thanks,

   

  Carlos A. Castillo.
  Ingeniero de desarrollo
  [EMAIL PROTECTED]
  


  Su Aliado Efectivo en Internet
  www.imagine.com.co
  (57 1)2182064 - (57 1)6163218
  Bogotá - Colombia 
  
  - Soluciones web para Internet e Intranet

  - Soluciones para redes
  - Licenciamiento de Software
  - Asesoría y Soporte Técnico
  

   


[PHP] Re: COOKIES Question?

2003-06-06 Thread Bix
Not possible AFAIK since it would negate the point in having a local cookie
policy and would leave possibility for abuse.

Bix

Joaco [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I was wondering if anyone out there knew if there was any code you could
add
 to your page that would allow the user to accept a cookie from your site
 even though the browser has denied it due to security settings.

 Basically, can I add a button that will allow a viewer to allow cookies on
 their machine even though their settings would normally block it?

 Thanks,

 Joaco





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Cookies disabled, new session ID each click!

2002-11-04 Thread Steve Fatula
What you describe is what SHOULD happen and does on that web site, that 
does NOT happen on my web site, with the exact same code I posted in the 
original message.

So, the question remains, what would cause the SID to be blank every 
other click?

Yes, I have also used Netscape on Linux to connect to the same machine 
without cookies, same result.

Steve

Jason Wong wrote:

On Monday 04 November 2002 10:24, Steve Fatula wrote:


If you want to see a site where the small program works (and be SURE and
turn cookies off), click here:
http://www.thewebmakerscorner.com/snapmods_new/default_test.php


So, can anyone tell me why it does not work on MY site(s)? Any ideas?
Surely this is a PHP configuration issue/bug perhaps? Logically, I don't
see any settings that could possibly affect the outcome using this



Have you tried any browsers other than IE 5.5?

First time I go into that page, my URL shows this

 http://www.thewebmakerscorner.com/snapmods_new/default_test.php

Clicking on the link appends the session id to the URL. As does clicking on 
the link again (same session id). Ad infinitum.

So basically it works?




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Cookies disabled, new session ID each click!

2002-11-04 Thread Jason Wong
On Tuesday 05 November 2002 05:15, Steve Fatula wrote:
 What you describe is what SHOULD happen and does on that web site, that
 does NOT happen on my web site, with the exact same code I posted in the
 original message.

Presumably the test website and your website are on different servers -- try 
comparing php.ini.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
That's life.
What's life?
A magazine.
How much does it cost?
Two-fifty.
I only have a dollar.
That's life.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] RE: Cookies disabled, new session ID each click!

2002-11-03 Thread Oleg Krogius
You do not need to add any SID to your links. Those will be added
automatically by the php session system when needed.

-Original Message-
From: Steve Fatula [mailto:sfatula;usa.net] 
Sent: Saturday, November 02, 2002 10:29 PM
To: [EMAIL PROTECTED]
Subject: Cookies disabled, new session ID each click!

I posted this but not sure Google works, so using my own account as it 
did not show up yet.

I am fairly new to PHP, and am running a shopping cart app written in 
PHP. Most people using this cart do not have this issue, but I do!

I have boiled the program down to a few lines, and it doesn't work. When

you click on the link in the code, it gives you a session ID. Then, when

you click again, it goes away. The SID appears to be blank every other
time.

Why would that be? I am using PHP 4.2.0 and 4.2.2, BSD and Linux, and 
Apache 1.3.20 something. Two different hosts. Same result. Client is 
IE5.5 with cookies disabled, running on NT. New session file is 
generated even though one already existed. This happens every other 
click as SID is blank every other click.

Please help me understand what the issue is.

Steve

?php
session_name('Steve');
session_start();
?
!doctype html public -//W3C//DTD HTML 4.01 Transitional//EN
html
head
meta http-equiv=Content-Type content=text/html
titleTest Page/title
/head
body marginwidth=0 marginheight=0 topmargin=0 bottommargin=0 
leftmargin=0 rightmargin=0
?php echo 'a href=http://linux.office.home/catalog/default_test.php?'

. SID . 'link to me/a'; ?
/body
/html





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Cookies disabled, new session ID each click!

2002-11-03 Thread Steve Fatula
Oleg and anyone else, PLEASE READ THE POST.

This is vendor software, this is what it does, it doesn't matter if it's 
the way you would do it, if it is the best way, or anything else. So, 
please tell me why the short program I uploaded as an example does or 
does not work for you.

Steve


Oleg Krogius wrote:

You do not need to add any SID to your links. Those will be added
automatically by the php session system when needed.

-Original Message-
From: Steve Fatula [mailto:sfatula;usa.net] 
Sent: Saturday, November 02, 2002 10:29 PM
To: [EMAIL PROTECTED]
Subject: Cookies disabled, new session ID each click!

I posted this but not sure Google works, so using my own account as it 
did not show up yet.

I am fairly new to PHP, and am running a shopping cart app written in 
PHP. Most people using this cart do not have this issue, but I do!

I have boiled the program down to a few lines, and it doesn't work. When

you click on the link in the code, it gives you a session ID. Then, when

you click again, it goes away. The SID appears to be blank every other
time.

Why would that be? I am using PHP 4.2.0 and 4.2.2, BSD and Linux, and 
Apache 1.3.20 something. Two different hosts. Same result. Client is 
IE5.5 with cookies disabled, running on NT. New session file is 
generated even though one already existed. This happens every other 
click as SID is blank every other click.

Please help me understand what the issue is.

Steve

?php
session_name('Steve');
session_start();
?
!doctype html public -//W3C//DTD HTML 4.01 Transitional//EN
html
head
meta http-equiv=Content-Type content=text/html
titleTest Page/title
/head
body marginwidth=0 marginheight=0 topmargin=0 bottommargin=0 
leftmargin=0 rightmargin=0
?php echo 'a href=http://linux.office.home/catalog/default_test.php?'

. SID . 'link to me/a'; ?
/body
/html






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Cookies disabled, new session ID each click!

2002-11-03 Thread Steve Fatula
If you want to see a site where the small program works (and be SURE and 
turn cookies off), click here: 
http://www.thewebmakerscorner.com/snapmods_new/default_test.php


So, can anyone tell me why it does not work on MY site(s)? Any ideas? 
Surely this is a PHP configuration issue/bug perhaps? Logically, I don't 
see any settings that could possibly affect the outcome using this 
technique.

Steve



Steve Fatula wrote:

Oleg and anyone else, PLEASE READ THE POST.

This is vendor software, this is what it does, it doesn't matter if it's 
the way you would do it, if it is the best way, or anything else. So, 
please tell me why the short program I uploaded as an example does or 
does not work for you.

Steve


Oleg Krogius wrote:

You do not need to add any SID to your links. Those will be added
automatically by the php session system when needed.

-Original Message-
From: Steve Fatula [mailto:sfatula;usa.net] Sent: Saturday, November 
02, 2002 10:29 PM
To: [EMAIL PROTECTED]
Subject: Cookies disabled, new session ID each click!

I posted this but not sure Google works, so using my own account as it 
did not show up yet.

I am fairly new to PHP, and am running a shopping cart app written in 
PHP. Most people using this cart do not have this issue, but I do!

I have boiled the program down to a few lines, and it doesn't work. When

you click on the link in the code, it gives you a session ID. Then, when

you click again, it goes away. The SID appears to be blank every other
time.

Why would that be? I am using PHP 4.2.0 and 4.2.2, BSD and Linux, and 
Apache 1.3.20 something. Two different hosts. Same result. Client is 
IE5.5 with cookies disabled, running on NT. New session file is 
generated even though one already existed. This happens every other 
click as SID is blank every other click.

Please help me understand what the issue is.

Steve

?php
session_name('Steve');
session_start();
?
!doctype html public -//W3C//DTD HTML 4.01 Transitional//EN
html
head
meta http-equiv=Content-Type content=text/html
titleTest Page/title
/head
body marginwidth=0 marginheight=0 topmargin=0 bottommargin=0 
leftmargin=0 rightmargin=0
?php echo 'a href=http://linux.office.home/catalog/default_test.php?'

. SID . 'link to me/a'; ?
/body
/html








--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Cookies disabled, new session ID each click!

2002-11-03 Thread Jason Wong
On Monday 04 November 2002 10:24, Steve Fatula wrote:
 If you want to see a site where the small program works (and be SURE and
 turn cookies off), click here:
 http://www.thewebmakerscorner.com/snapmods_new/default_test.php


 So, can anyone tell me why it does not work on MY site(s)? Any ideas?
 Surely this is a PHP configuration issue/bug perhaps? Logically, I don't
 see any settings that could possibly affect the outcome using this

Have you tried any browsers other than IE 5.5?

First time I go into that page, my URL shows this

 http://www.thewebmakerscorner.com/snapmods_new/default_test.php

Clicking on the link appends the session id to the URL. As does clicking on 
the link again (same session id). Ad infinitum.

So basically it works?

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
University politics are vicious precisely because the stakes are so small.
-- Henry Kissinger
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Re: Cookies

2002-07-26 Thread John Huggins

Thanks for responding.  It turns out this is a known bug in 4.2.2 along with
Apache 2.x.x according to the developers.  The CVS snapshots seem to work,
but I have moved back to Apache 1.3.x from the 2.x.x stuff.

http://groups.google.com/groups?q=php+4.2.2+cookie+bugie=UTF-8oe=UTF-8hl=
en


So watch out for 4.2.2 if you use Apache 2.x.x.  It seems to be okay with
Apache 1.3.26.

John

 -Original Message-
 From: Richard Lynch [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 26, 2002 12:33 PM
 To: John S. Huggins
 Cc: [EMAIL PROTECTED]
 Subject: [PHP] Re: Cookies


 
 Say it is not so.
 
 I hear the PHP 4.2.2 will only set the last cookie delivered by a browser
 to a variable in the PHP environment.
 
 Is this true?

 Huh?

 Do you mean last cookie of the same NAME maybe?

 Because that's probably quite likely, and within 'spec' for the
 Cookie Spec.

 They will all be in an array $_COOKIE['foo'] rather than as a
 global $foo by
 default -- You can change that in php.ini if you don't care about
 security,
 which is a Bad Idea, but might be what you have to do until you convert...

 --
 Like Music?  http://l-i-e.com/artists.htm
 I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
 major distro).  Need to record live events (mixed already) to stereo
 CD-quality.  Soundcard Recommendations?
 Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
 post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
 audio-to-disk.

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Cookies - good or bad???

2002-07-18 Thread Kondwani Spike Mkandawire

 Before I started to read up on sessions, I simply used my own form of
 session management by sending all relevant variables either via URL or
 via form fields to the subsequent pages. Obviously this method leaves a
 bunch of holes as well, but I KNOW that my application is always pure
 and simple HTML, doesn't have browser issues, doesn't have cookie
 issues, so 100% of the internet community can use it.

 Does anyone out there have a view/practise when it comes to
 session/cookies? - basically I am still not convinced that using
 sessions/cookies is a good idea, but I would love to be educated as to
 why I should...

 The issue on Advantages and disadvantages of Cookies has been
discussed numerous amounts of times...  There was also debate on
using I.P vs Cookies, I see from your address that you are based in
S.A. meaning there is still numerous amounts of people set on dial up
hence allocating someone a specific id via dial up would be totally
out of the question (dial up IP changes)...  Through the discussions
I was convinced that Cookies are and ought to be the best way to go...
Most people use IE/Netscape which does not ask if you want to
accept or reject cookies like the browsers that are generic to Linux
namely Konqueror and Lynx...  Furthermore, I don't know too
many people that scrimmage through their hard drive searching for
Cookies to delete...  besides most people (unless they have done
a great deal of web programming) don't know what a Cookie is,
so if they actually do get prompted to accept or reject a Cookie the
odds of them Accepting are equal to the odds of them rejecting
(probably even higher considering most prompts require a Yes)...

I'd say Cookies and Sessions are quite reliable...  Well, they are
the safest method I know to go about the problem of monitoring
ones surfing habits...  If anyone can think of another please post
her up, I'd be curious to learn of it...

Regards,
Kondwani



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Cookies - good or bad???

2002-07-18 Thread Cord Schneider

Phpcoder [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm really battling with this whole session thing.
 My first impressions are that cookies are OK, and really helps to make
 sessions workable and efficient, YET, from a developers point of view, I
[..snip..]
 Does anyone out there have a view/practise when it comes to
 session/cookies? - basically I am still not convinced that using
 sessions/cookies is a good idea, but I would love to be educated as to
 why I should...

A number of people have offered their opinion why cookies are a bad idea. As
a developer new to PHP, if cookies are such a big a big no-no, how does one
do effective session management without storing anything client-side?? Bear
in mind that the browser is stateless and, the user can disconnect and
reconnect in between fetching pages from your site.

Regards,
Cord




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Cookies - good or bad???

2002-07-18 Thread Scott Fletcher

Instead of Cookies, I use Sessions which is run on hte server side.  So, I
use the

--snip--
  $salt = strtoupper(md5(uniqid(rand(;
  session_id($salt);
  session_start();
  header(Location: https://xxx.yyy.zzz/index.php?.SID.init_login=TRUE;);
--snip--

to create the identifer for an unique person.  Then use the php script that
take care of the session management such as logging the user out when time
is up as an example.  Another script was used to prevent the direct access
attempt.  Another script was used to detect whether the server have the
user's identifier in the server, if not exist then would force the web
browser to the login page.

As for the newbie, well, sometime they had to learn it from the pro.
Although it would be nice if there is documentation somewhere.


Cord Schneider [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Phpcoder [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I'm really battling with this whole session thing.
  My first impressions are that cookies are OK, and really helps to make
  sessions workable and efficient, YET, from a developers point of view, I
 [..snip..]
  Does anyone out there have a view/practise when it comes to
  session/cookies? - basically I am still not convinced that using
  sessions/cookies is a good idea, but I would love to be educated as to
  why I should...

 A number of people have offered their opinion why cookies are a bad idea.
As
 a developer new to PHP, if cookies are such a big a big no-no, how does
one
 do effective session management without storing anything client-side??
Bear
 in mind that the browser is stateless and, the user can disconnect and
 reconnect in between fetching pages from your site.

 Regards,
 Cord






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Cookies - good or bad???

2002-07-18 Thread Kondwani Spike Mkandawire

Awesome Scott...  That's some wicked code...
Scott Fletcher [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Instead of Cookies, I use Sessions which is run on hte server side.  So, I
 use the

 --snip--
   $salt = strtoupper(md5(uniqid(rand(;
   session_id($salt);
   session_start();
   header(Location:
https://xxx.yyy.zzz/index.php?.SID.init_login=TRUE;);
 --snip--

 to create the identifer for an unique person.  Then use the php script
that
 take care of the session management such as logging the user out when time
 is up as an example.  Another script was used to prevent the direct access
 attempt.  Another script was used to detect whether the server have the
 user's identifier in the server, if not exist then would force the web
 browser to the login page.

 As for the newbie, well, sometime they had to learn it from the pro.
 Although it would be nice if there is documentation somewhere.


 Cord Schneider [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Phpcoder [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   I'm really battling with this whole session thing.
   My first impressions are that cookies are OK, and really helps to make
   sessions workable and efficient, YET, from a developers point of view,
I
  [..snip..]
   Does anyone out there have a view/practise when it comes to
   session/cookies? - basically I am still not convinced that using
   sessions/cookies is a good idea, but I would love to be educated as to
   why I should...
 
  A number of people have offered their opinion why cookies are a bad
idea.
 As
  a developer new to PHP, if cookies are such a big a big no-no, how does
 one
  do effective session management without storing anything client-side??
 Bear
  in mind that the browser is stateless and, the user can disconnect and
  reconnect in between fetching pages from your site.
 
  Regards,
  Cord
 
 
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Cookies - good or bad???

2002-07-18 Thread Scott Fletcher

Well, I have to have to it becuase my company is a credit report reseller.
I can't image if someone can easily break in.  :-)  As long as I don't work
for CIA or FBI then I'll be fine!

Kondwani Spike Mkandawire [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Awesome Scott...  That's some wicked code...
 Scott Fletcher [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Instead of Cookies, I use Sessions which is run on hte server side.  So,
I
  use the
 
  --snip--
$salt = strtoupper(md5(uniqid(rand(;
session_id($salt);
session_start();
header(Location:
 https://xxx.yyy.zzz/index.php?.SID.init_login=TRUE;);
  --snip--
 
  to create the identifer for an unique person.  Then use the php script
 that
  take care of the session management such as logging the user out when
time
  is up as an example.  Another script was used to prevent the direct
access
  attempt.  Another script was used to detect whether the server have the
  user's identifier in the server, if not exist then would force the web
  browser to the login page.
 
  As for the newbie, well, sometime they had to learn it from the pro.
  Although it would be nice if there is documentation somewhere.
 
 
  Cord Schneider [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Phpcoder [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I'm really battling with this whole session thing.
My first impressions are that cookies are OK, and really helps to
make
sessions workable and efficient, YET, from a developers point of
view,
 I
   [..snip..]
Does anyone out there have a view/practise when it comes to
session/cookies? - basically I am still not convinced that using
sessions/cookies is a good idea, but I would love to be educated as
to
why I should...
  
   A number of people have offered their opinion why cookies are a bad
 idea.
  As
   a developer new to PHP, if cookies are such a big a big no-no, how
does
  one
   do effective session management without storing anything client-side??
  Bear
   in mind that the browser is stateless and, the user can disconnect and
   reconnect in between fetching pages from your site.
  
   Regards,
   Cord
  
  
  
 
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Cookies - good or bad???

2002-07-18 Thread Justin French

on 19/07/02 1:19 AM, Cord Schneider ([EMAIL PROTECTED]) wrote:

 A number of people have offered their opinion why cookies are a bad idea. As
 a developer new to PHP, if cookies are such a big a big no-no, how does one
 do effective session management without storing anything client-side?? Bear
 in mind that the browser is stateless and, the user can disconnect and
 reconnect in between fetching pages from your site.

You pass the session around in the URL

Something like A HREF=page.php?SIDclick here/a, or you might build a
wrapper function that does it for you:

A HREF=?=link('page.php')?click here/a.


Yes, that's every internal (relative) URL on your whole site :)


It becomes a trade-off between the convent but unreliable cookies, versus
the 100% accessible, but perhaps time consuming/tricky URL method.


As has been said on this list MANY times, just have a look at the big sites
like amazon.com -- no cookies, no javascript, no reliance on client-side for
anything.  Take care of it all server-side, where you have a controlled
environment.


Justin French


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Cookies - good or bad???

2002-07-18 Thread Scott Fletcher

I never heard of this php function, link().  Sound like a good function,
I'm going to have to look it up!

Thanks,
 FletchSOD
Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 on 19/07/02 1:19 AM, Cord Schneider ([EMAIL PROTECTED]) wrote:

  A number of people have offered their opinion why cookies are a bad
idea. As
  a developer new to PHP, if cookies are such a big a big no-no, how does
one
  do effective session management without storing anything client-side??
Bear
  in mind that the browser is stateless and, the user can disconnect and
  reconnect in between fetching pages from your site.

 You pass the session around in the URL

 Something like A HREF=page.php?SIDclick here/a, or you might build a
 wrapper function that does it for you:

 A HREF=?=link('page.php')?click here/a.


 Yes, that's every internal (relative) URL on your whole site :)


 It becomes a trade-off between the convent but unreliable cookies, versus
 the 100% accessible, but perhaps time consuming/tricky URL method.


 As has been said on this list MANY times, just have a look at the big
sites
 like amazon.com -- no cookies, no javascript, no reliance on client-side
for
 anything.  Take care of it all server-side, where you have a controlled
 environment.


 Justin French




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Cookies - good or bad???

2002-07-18 Thread Justin French

on 19/07/02 4:49 AM, Scott Fletcher ([EMAIL PROTECTED]) wrote:

 I never heard of this php function, link().  Sound like a good function,
 I'm going to have to look it up!

Ummm, sorry, it's one that I wrote myself in my library of code -- not an
official function.

my function link() takes the standard link, and adds the SID to it.  It's
not that tricky, all it does is check if there's already a query string, if
there is, it appends the SID with , otherwise with ?.


Justin French


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re[2]: [PHP] Re: Cookies - good or bad???

2002-07-18 Thread Evgeny Chuykov

Justin French wrote:

JF As has been said on this list MANY times, just have a look at the big sites
JF like amazon.com -- no cookies, no javascript, no reliance on client-side for
JF anything.  Take care of it all server-side, where you have a controlled
JF environment.

And what about yahoo.com? Is it big enough? :)

-- 
Best regards,
 Evgeny


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: cookies

2002-07-11 Thread Richard Lynch

Nope thats not they way
If you don't specify a expire date it will live for ever or until you delete
it.

The only way is to set it with an expiry date and then it will delete
it'self when the browser closes.
Check this by running a file on the same domain with phpinfo();

No.

If you send no expiration date, it expires when the browsers are all closed.

Read the Cookie spec.

Not that MS actually got all of the Cookie spec correct, but they got that
part right.

To erase a cookie, just do:

setcookie('cookie', '');


-- 
Like Music?  http://l-i-e.com/artists.htm
Off-Topic:  What is the moral equivalent of 'cat' in Windows?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: cookies

2002-07-11 Thread Daniel

Surely it would be better to use Sessions in this case?


Danny Shepherd [EMAIL PROTECTED] wrote in message
08c501c22825$932917c0$0200a8c0@DANNYS">news:08c501c22825$932917c0$0200a8c0@DANNYS...
 No, I just tested it myself - if you set a cookie with no expire date it
 exists until the browser window is closed.

 My code:

 ?php

 if (!isset($_COOKIE['TestCookie']))
 {
  setcookie (TestCookie, FUD);
  echo Just Set a cookie - reload the page;
 }
 else
 {
  echo Cookie is : {$_COOKIE['TestCookie']}brClose the window then
return
 and the cookie should be gone;
 }

 ?

 HTH

 Danny.

 - Original Message -
 From: vins [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, July 10, 2002 3:34 PM
 Subject: [PHP] Re: cookies


  Nope thats not they way
  If you don't specify a expire date it will live for ever or until you
 delete
  it.
 
  The only way is to set it with an expiry date and then it will delete
  it'self when the browser closes.
  Check this by running a file on the same domain with phpinfo();
 
 
  Alexander Ross [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   How can I set a cookie which expires when the borwser is closed??  How
 can
  I
   delete a cookie via PHP?
  
   Thanks
  
  
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: cookies

2002-07-10 Thread richard . mail

Alexander Ross writes: 

 How can I set a cookie which expires when the borwser is closed??  How can I
 delete a cookie via PHP? 
 
 Thanks 
 
  
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php 
 
simply give it no experation time.
then it will expire when your browser is closed :) 

( and yes it works, i use it to ) 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: cookies

2002-07-10 Thread lherbst


My experience with cookies that have no expiration date has not been as
successful.  It seems that (in IE6 anyway) the behavior is inconsistent.
Sometimes the cookie would last until I closed the browser, sometimes the
cookie would expire in the middle of the session for no apparent reason.
This behavior may not occur in other browsers though.  I'd test the cookies
with the browser(s) that you will be using for your application.

Lee




   
   
richard.mail@so
   
fthome.net To: [EMAIL PROTECTED]   
   
   cc: 
   
07/10/2002 Subject: [PHP] Re: cookies  
   
09:58 AM   
   
   
   
   
   



Alexander Ross writes:

 How can I set a cookie which expires when the borwser is closed??  How
can I
 delete a cookie via PHP?

 Thanks



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

simply give it no experation time.
then it will expire when your browser is closed :)

( and yes it works, i use it to )


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: cookies

2002-07-10 Thread vins

Nope thats not they way
If you don't specify a expire date it will live for ever or until you delete
it.

The only way is to set it with an expiry date and then it will delete
it'self when the browser closes.
Check this by running a file on the same domain with phpinfo();


Alexander Ross [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 How can I set a cookie which expires when the borwser is closed??  How can
I
 delete a cookie via PHP?

 Thanks





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: cookies

2002-07-10 Thread Danny Shepherd

No, I just tested it myself - if you set a cookie with no expire date it
exists until the browser window is closed.

My code:

?php

if (!isset($_COOKIE['TestCookie']))
{
 setcookie (TestCookie, FUD);
 echo Just Set a cookie - reload the page;
}
else
{
 echo Cookie is : {$_COOKIE['TestCookie']}brClose the window then return
and the cookie should be gone;
}

?

HTH

Danny.

- Original Message -
From: vins [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 10, 2002 3:34 PM
Subject: [PHP] Re: cookies


 Nope thats not they way
 If you don't specify a expire date it will live for ever or until you
delete
 it.

 The only way is to set it with an expiry date and then it will delete
 it'self when the browser closes.
 Check this by running a file on the same domain with phpinfo();


 Alexander Ross [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  How can I set a cookie which expires when the borwser is closed??  How
can
 I
  delete a cookie via PHP?
 
  Thanks
 
 



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Cookies

2002-07-09 Thread Derick Rethans

Hey,

for good (and funny) tutorial on cookies:
http://www.htmlgoodies.com/tutors/cookie.html

you can find some examples here:
http://www.php.net/manual/en/function.setcookie.php

Derick


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: cookies

2002-06-24 Thread Tracker 1

Paul O'Neil [EMAIL PROTECTED] wrote in message...
 If a browser has cookies blocked , anyone have code if unable to
 set cookie then goto another page.

at the top of a page.. psuedo code

if cookie['test'] exists...
if true //cool
else
if get['cookietest'] exists
cookietest failed, redirect
else
set test cookie, and redirect to self
with ?cookietest=true

this should work for you... :D

--
===
Michael J. Ryan  -  tracker1[*at*]theroughnecks.com
Roughneck BBS: http://www.theroughnecks.net  telnet://theroughnecks.net
===
Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email
One program for aim/icq/yahoo/msn/irc  -  http://www.trillian.cc/




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Cookies and Variables

2001-11-20 Thread Jason G.

Keep it mind that EGPCS is in that order for a reason. Changing it can open 
up security problems...

-JAson Garbr


At 01:16 PM 11/20/2001 -0800, Fred wrote:
If you want certain variables to over ride cookie variables you need to
change the setting of the variables_order directive in php.ini:

variables_order string
Set the order of the EGPCS (Environment, GET, POST, Cookie, Server) variable
parsing. The default setting of this directive is EGPCS. Setting this to
GP, for example, will cause PHP to completely ignore environment
variables, cookies and server variables, and to overwrite any GET method
variables with POST-method variables of the same name.

Fred

Richard S. Crawford [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Consider this code, in page1.php:

?php
  setcookie(someWord,I am a cookie);
?

...and this code, in page2.php:

?php
  setcookie(someWord,$someWord);
  print (someWord says: $someWord);
  $someWord = I am a variable;
  print ( a href=\page2.php?someWord=$someWord\ Click here /a
 );
?

(In the actual code, the value of $someWord is passed via POST through a
form, but the principle is the same.)

The first time I load page2.php, the output should be:

  someWord says: I am a cookie

Which, of course, works perfectly.

But each subsequent time I load page2.php, I want the output to be:

  someWord says: I am a variable

and then set the value of the cookie someWord to I am a variable.

But that's not what happens.  Everytime I load page2.php, someWord tells me
that it is a cookie.

How do I get the value of the variable to override the value of the cookie?




Sliante,
Richard S. Crawford

http://www.mossroot.com
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
MSN: [EMAIL PROTECTED]

It is only with the heart that we see rightly; what is essential is
invisible to the eye.  --Antoine de Saint Exupéry

Push the button, Max!




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Cookies won't stick

2001-11-02 Thread Mike Frazer

I believe it's just the opposite, for the sake of safety.  Besides, good
coding practices in ANY language generally means you include all possible
information, required or not (it's like HTML; you don't have to use quotes
around attributes but to be forward compatible it's recommended).

Mike Frazer
http://www.spyproductions.com/


Jennyw [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 For some reason, when I tried using setcookie(), cookies wouldn't stick
 around. When I added an expiration time, cookies started sticking around,
 but ... I thought that if you didn't provide an expiration they were
 supposed to stick around indefinitely?

 Thanks!

 Jen







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: cookies

2001-09-25 Thread Oliver Ruf

Hi m8

I just say... rtfm ... start here:


From the manual:.. (http://www.php.net/manual/en/function.setcookie.php)

int setcookie (string name [, string value [, int expire [, string path [, 
string domain [, int secure])



- Oliver




[EMAIL PROTECTED] (Joseph Bannon) wrote in
[EMAIL PROTECTED]:">news:[EMAIL PROTECTED]: 

 When I set a cookie like below, what does the 300 represend in
 time? Seconds?
 
 setcookie (referred, yes, 300, , .advparadigm.com,0);
 
 
 Thanks,
 Joseph
 
 
 
 
 
 
 
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Re: cookies

2001-09-25 Thread Joseph Bannon

And this is where I say  kma  thanks.

J








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: Cookies and servers problems

2001-08-08 Thread Richard Lynch

Check that you still have register_globals on/off in php.ini as before, and
that your GPC ordering is the same.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: InéRcia Sensorial [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Sent: Saturday, August 04, 2001 1:01 PM
Subject: Cookies and servers problems


   Hi All,

   I used to run a customized version of Php-Nuke (www.phpnuke.org) on a
 server that had PHP 4.05, Linux and Apache. Used to run fine.

   Now I am trying to run the same, just downloaded and uploaded to the new
 server, but it is a Windows, IIS, with PHP 4.0.3pl1. The phpinfo(); of the
 new server can be seen here:

 http://www.arubaito.com.br/info.php

   Okay, now with the problem. I customized Nuke to allow users to be
 attached to 'companies', and the articles be displayed only for certain
 companies. So, only an user from a specific company can have access to the
 article.

   But now, it is not working. The sql query is feed by a WHERE
 company='$user_company' part, where the $user_company comes from another
 sql query, based on the login name from a cookie.

   If I change $user_company to 1, it grabs the articles.

   So, the problem is with the cookies. The new server is not sending it
 right. I tested on 2 or 3 machines, all with different Operating Systems
and
 browsers (win98, win2k, IE, Netscape, Opera).

   Anyone have an idea if the new server I am on and its configuration has
 some kind of trouble to manage cookies properly?

   Thanks in advance,

   Julio Nobrega.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]