Re: [PHP] Cookie problem

2006-01-15 Thread Curt Zirzow
On Sat, Jan 14, 2006 at 12:57:46PM -0500, Al wrote:
 Can't get a cookie to set. Below is the code near the file top BEFORE any 
 html output.
 ...
 ## code
 print_r($_POST)
 session_start();
 print_r($_COOKIE);

headers could be sent already, up your error_reporting, or check
your logs for headers already sent on line ...

 
 if(isset($_POST['prefs']))
   $cookie= setcookie(listpref, $_POST['filter'], time()+7776000);

what is the time() on the server vs the client?
is $_POST['filter'] set?

what is the actual header content set upon request?
livehttpheaders for Firefox is a good tool, if you dont have that
then the 'View Response Headers' via the Web Developer tool for
Firefox.

Curt.
-- 
cat .signature: No such file or directory

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



Re: [PHP] Cookie problem

2006-01-14 Thread Aaron Koning
Try simplifying the problem to determine the error point. For example don't
involve $_POST just try setting a cookie with hard coded variables. If that
works then add in the $_POST and test for BOTH $_POST['prefs'] and
$_POST['filter'].

Example of simplification:

?php
// Send cookie
setcookie(listpref,selected,time()+7776000);
?

Aaron


On 1/14/06, Al [EMAIL PROTECTED] wrote:

 Can't get a cookie to set. Below is the code near the file top BEFORE any
 html output.

 $_POST['prefs'] comes from a hidden field in the middle of the html
 output.

 $_POST['filter'] comes from a select option.

 A Submit button closes the page and refreshes it.

 print_r($_POST) shows $_POST['prefs'] $_POST['prefs'] are just as I expect
 when the page refreshes.

 ## code
 print_r($_POST)
 session_start();
 print_r($_COOKIE);

 if(isset($_POST['prefs']))
 $cookie= setcookie(listpref, $_POST['filter'], time()+7776000);

 var_dump($cookie) shows bool TRUE

 I added the session_start() as a test.

 print_r($_COOKIE) shows the session ID cookie works just fine.

 IE6 and Firefox don't record the regular cookie.

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




Re: [PHP] Cookie problem with IE

2005-11-22 Thread Kristen G. Thorson

Jay Blanchard wrote:


But I sure would like to see the URL once he has clicked it. Have you tried
changing to $_GET['page']? Again, all of this is just for gigglesbut
there is likely to be a clue.

On privacy policies in IE (can he try another browser?) what is his setting?

 





I'm still waiting on definitive word as to what exactly his privacy 
settings are.  In my experiments, manually setting IE to Always Allow 
or Always Block cookies for a domain will completely override privacy 
settings.  I've had IE privacy set to allow no cookies, and manually 
added the domain to Always Allow and this overrode the no cookies setting.


For kicks and giggles, I changed $_REQUEST to $_GET, but he reported no 
difference.  Again, I don't see this as being the problem, since if it 
were so, he'd get no output at all instead of Cookie NOT set.  I'm 
quite convinced this is a matter of his cookie simply not being set.  He 
is not able to ever see a cookie for this domain in his temp internet 
files folder, though he tells us there are other cookies there.


I wish I could tell him to just use another friggin browser, but it 
would be nice to fix it so he can use the one he wants, no matter what 
words one can say about his choice. ;)


I have not looked into it, but do some internet security apps like 
Norton try to block certain cookies?  I've not come across this, as I 
don't really use those programs, but right now I'm grasping for straws.


thanks for the help so far,
kgt

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



RE: [PHP] Cookie problem with IE

2005-11-22 Thread Jay Blanchard
[snip]
I have not looked into it, but do some internet security apps like 
Norton try to block certain cookies?  I've not come across this, as I 
don't really use those programs, but right now I'm grasping for straws.
[/snip]

Certain anti-virus/spyware programs can and do block cookies and can be very
specific. Do you know if he is using something loike that? If so, can you
determine the settings?

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



RE: [PHP] Cookie problem with IE

2005-11-21 Thread Jay Blanchard
[snip]
Anyone have any suggestions?  I'm still stuck.
[/snip]

Can you send him another test where a basic cookie gets set and then
checked?

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



Re: [PHP] Cookie problem with IE

2005-11-21 Thread Kristen G. Thorson

Jay Blanchard wrote:


[snip]
Anyone have any suggestions?  I'm still stuck.
[/snip]

Can you send him another test where a basic cookie gets set and then
checked?

.

 




Not sure what you mean.  I sent him to this script:

?php
if( !isset( $_REQUEST['page'] ) ) {
setcookie('VATtest','Cookie has been set.',time()+5, /);
echo 'a href='.$_SERVER['PHP_SELF'].'?page=1Test cookie./a';
} else if( $_REQUEST['page'] == '1' ) {
if( isset( $_COOKIE['VATtest'] ) ) {
  echo $_COOKIE['VATtest'];
} else {
  echo 'Cookie NOT set.';
}
}
?

Which is all I had in entirety.  Is this not a basic cookie?


thanks,

kgt

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



RE: [PHP] Cookie problem with IE

2005-11-21 Thread Jay Blanchard
[snip]
Not sure what you mean.  I sent him to this script:

?php
if( !isset( $_REQUEST['page'] ) ) {
 setcookie('VATtest','Cookie has been set.',time()+5, /);
 echo 'a href='.$_SERVER['PHP_SELF'].'?page=1Test cookie./a';
} else if( $_REQUEST['page'] == '1' ) {
 if( isset( $_COOKIE['VATtest'] ) ) {
   echo $_COOKIE['VATtest'];
 } else {
   echo 'Cookie NOT set.';
 }
}
?

Which is all I had in entirety.  Is this not a basic cookie?
[/snip]

Sorry, I should have paid more attention. Is $_REQUEST['page'] correctly set
when (print_r the array...just for giggles)

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



Re: [PHP] Cookie problem with IE

2005-11-21 Thread Kristen G. Thorson

Jay Blanchard wrote:


[snip]
Not sure what you mean.  I sent him to this script:

?php
if( !isset( $_REQUEST['page'] ) ) {
setcookie('VATtest','Cookie has been set.',time()+5, /);
echo 'a href='.$_SERVER['PHP_SELF'].'?page=1Test cookie./a';
} else if( $_REQUEST['page'] == '1' ) {
if( isset( $_COOKIE['VATtest'] ) ) {
  echo $_COOKIE['VATtest'];
} else {
  echo 'Cookie NOT set.';
}
}
?

Which is all I had in entirety.  Is this not a basic cookie?
[/snip]

Sorry, I should have paid more attention. Is $_REQUEST['page'] correctly set
when (print_r the array...just for giggles)

.

 



I can verify $_REQUEST is correct for me, and I'm sure it's correct for 
him too, since he gets Cookie NOT set.  The second if statement 
requires $_REQUEST['page'] to be 1 to even get to that line.  If 
$_REQUEST['page'] is not set, he should get no output at all.


I've been looking through the comments in the manual, and several people 
mention privacy policies creating a problem in IE.  My problem is none 
of this can be duplicated on my machine (or any other so far), and this 
customer is in Florida and I'm in Virginia.  I've also never seen in 
other applications that a privacy policy truly needed to be sent to 
allow a cookie to be set, and apparently the web site manager settings 
(where you explicitly allow or block cookies from certain domains) 
override all privacy settings in IE anyways.  So that seems like a dead end.




thanks,

kgt

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



RE: [PHP] Cookie problem with IE

2005-11-21 Thread Jay Blanchard
[snip]
Sorry, I should have paid more attention. Is $_REQUEST['page'] correctly
set
when (print_r the array...just for giggles)

I can verify $_REQUEST is correct for me, and I'm sure it's correct for 
him too, since he gets Cookie NOT set.  The second if statement 
requires $_REQUEST['page'] to be 1 to even get to that line.  If 
$_REQUEST['page'] is not set, he should get no output at all.
[/snip]

But I sure would like to see the URL once he has clicked it. Have you tried
changing to $_GET['page']? Again, all of this is just for gigglesbut
there is likely to be a clue.

On privacy policies in IE (can he try another browser?) what is his setting?

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



RE: [PHP] Cookie problem with old browser.

2004-01-21 Thread Katie Dewees
Chris W wrote:
 I don't know that this really matters, but I am having problems with
 cookies getting set when viewing my site with an old version of
 netscape, I still have installed 4.79.  I'm not that concerned with
 supporting that old of a browser but I am 99% sure the site was
 working with that browser at one time.  It works fine with all other
 browsers I have tired (Mozilla, IE, Opera, NS 7.1).  Does anyone know
 why the old version of netscape seems to be ignoring my cookies but
 still accepts cookies from other sites?  The set cookie code looks
 like this.

 setcookie(UserID, stripslashes($UserID), 0, '/', $mydomain);

 I know that $UserID and $mydomain are set right because it works in
 other browsers.

 BTW $mydomain is set to thewishzone.com  but you need to use port
 8086 on my testing machine to get at it.  Could that be the reason
 netscape
 4.79 isn't working with it?

 Chris W

We've had that same problem here with IE 5 for Mac. The solution ended up
being setting the cookie like this: setcookie(cookie_name, $cookie_value)
with nothing else (no time, etc.). That is the only way that old crappy
browser would accept the cookie.

Which leaves me to wonder...why are we still programming to support browsers
with obvious bugs in them?!?!

Katie Dewees
Web Developer/PHP Programmer
[EMAIL PROTECTED]
http://www.evans-young.com

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



Re: [PHP] cookie problem

2003-06-23 Thread David Nicholson
Hello,


This is a reply to an e-mail that you wrote on Mon, 23 Jun 2003 at 10:18,
lines prefixed by '' were originally written by you.
 I am using the following codes to create cookie and validate login,
 but some
 members can't login, I checked their username and password is
 correct..
$info =
 base64_encode($id:$username:$passwd:$fname:$lname:$suspended);

I haven't read all of your code but the first thing I can think to check
is... do any of your usernames or passwords have : characters in them?
if they do you will have to adjust your code to account for this.

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

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



Re: [PHP] cookie problem....

2003-02-13 Thread Jason Wong
On Thursday 13 February 2003 16:07, Terry Lau wrote:
 Hello,
 I created a PHP page that included cookie, here is the PHP code:
 ?php
 if (isset($HTTP_POST_VARS['Name'])) {
 setcookie(Name, $HTTP_POST_VARS['Name'], time()+86400*10);
 }

[snip]

 But when I called the cookie variable in another page, it showed
 Notice: Undefined index: Name in. Here is the PHP code in another
 page:

 html
 head
 titleUntitled Document/title
 meta http-equiv=Content-Type content=text/html; charset=big5
 /head

 body
 HI!! ?php echo $HTTP_COOKIE_VARS['Name']; ?
 /body
 /html

On the page where you want to read the cookie you need to call 
session_start().

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Electrocution, n.:
Burning at the stake with all the modern improvements.
*/


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




Re: [PHP] cookie problem....

2003-02-13 Thread Marek Kilimajer
This cannot be the problem, session_start is for sessions

Jason Wong wrote:

On Thursday 13 February 2003 16:07, Terry Lau wrote:
  

Hello,
I created a PHP page that included cookie, here is the PHP code:
?php
if (isset($HTTP_POST_VARS['Name'])) {
setcookie(Name, $HTTP_POST_VARS['Name'], time()+86400*10);
}



[snip]

  

But when I called the cookie variable in another page, it showed
Notice: Undefined index: Name in. Here is the PHP code in another
page:

html
head
titleUntitled Document/title
meta http-equiv=Content-Type content=text/html; charset=big5
/head

body
HI!! ?php echo $HTTP_COOKIE_VARS['Name']; ?
/body
/html



On the page where you want to read the cookie you need to call 
session_start().

  



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




Re: [PHP] cookie problem....

2003-02-13 Thread Rick Emery
I always use 4 parameters in my setcookie(cookie_name,cookie_value,time,/)
Also, verify that $HTTP_POST_VARS['Name'] exists by printing it
- Original Message - 
From: Jason Wong [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, February 13, 2003 7:20 AM
Subject: Re: [PHP] cookie problem


On Thursday 13 February 2003 16:07, Terry Lau wrote:
 Hello,
 I created a PHP page that included cookie, here is the PHP code:
 ?php
 if (isset($HTTP_POST_VARS['Name'])) {
 setcookie(Name, $HTTP_POST_VARS['Name'], time()+86400*10);
 }

[snip]

 But when I called the cookie variable in another page, it showed
 Notice: Undefined index: Name in. Here is the PHP code in another
 page:

 html
 head
 titleUntitled Document/title
 meta http-equiv=Content-Type content=text/html; charset=big5
 /head

 body
 HI!! ?php echo $HTTP_COOKIE_VARS['Name']; ?
 /body
 /html



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




RE: [PHP] cookie problem....

2003-02-13 Thread Bryan Lipscy
From your code snip it looks like you are missing ? after the if
contruct.  

Bryan


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




Re: [PHP] cookie problem. Not possible to set and read a cookie onthe same page?

2002-03-26 Thread Miguel Cruz

On Tue, 26 Mar 2002, andy wrote:
 I am wondering if it is possible to send a cookie and read it on the same
 page.
 
 Following environment:
 
 There is a cookie already on the machine of the client, but expired.
 Now I am setting a new cookie and reading it on the same page via $sess_id =
 $HTTP_COOKIE_VARS[$sesscookiename];
 
 Unfortuanaelly it gives me the old session id back. After refreshing I am
 getting the new sessid and everything works fine. The cookie has been sent
 with the right value, I did dubble check it. But the HTTP_C... reads the old
 one.

An HTTP request (the transaction between browser and server) always goes
like this:

1) The browser sends a request.
2) The server sends a response.

That's it.

This creates certain constraints. The browser sends the appropriate 
cookies (those in the right domain) to the server along with its request. 
The server then sends any new cookies back to the browser as part of its 
response.

There is no chance for the server to re-read the cookies from the browser 
after step 2 above, unless, as you've observed, you refresh the page, 
which in effect just repeats both steps.

miguel


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




Re: [PHP] cookie problem. Not possible to set and read a cookie on the same page?

2002-03-26 Thread Erik Price


On Tuesday, March 26, 2002, at 11:42  AM, Miguel Cruz wrote:

 There is no chance for the server to re-read the cookies from the 
 browser
 after step 2 above, unless, as you've observed, you refresh the page,
 which in effect just repeats both steps.

One ugly way that I've gotten around this in one of my scripts was to 
set the cookie, and then use header(location: samepage.php) to refresh 
the page -- worked fine, and if all you do is set the cookie before 
calling header() it should be practically unnoticeable.


Erik






Erik Price
Web Developer Temp
Media Lab, H.H. Brown
[EMAIL PROTECTED]


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




RE: [PHP] cookie problem. Not possible to set and read a cookie on the same page?

2002-03-26 Thread Rick Emery

Direct answer: No, you cannot read a cookie on the same page that creates
it.

The question is: why would you want to?

After all, you already have the data available to you that you would read
from the cookie because you had to use it to create the cookie on that page.


-Original Message-
From: andy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 10:39 AM
To: [EMAIL PROTECTED]
Subject: [PHP] cookie problem. Not possible to set and read a cookie on
the same page?


Hi there,

I am wondering if it is possible to send a cookie and read it on the same
page.

Following environment:

There is a cookie already on the machine of the client, but expired.
Now I am setting a new cookie and reading it on the same page via $sess_id =
$HTTP_COOKIE_VARS[$sesscookiename];

Unfortuanaelly it gives me the old session id back. After refreshing I am
getting the new sessid and everything works fine. The cookie has been sent
with the right value, I did dubble check it. But the HTTP_C... reads the old
one.

why? Thanx for any help,

Andy





-- 
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




Re: [PHP] Cookie problem

2001-09-20 Thread Richard Baskett

Here use this cookie that I wrote, it works in every browser, every os.



function NextYear () {
$today  = gmdate(l, d-M-);
$today .= gmdate(Y)+1;
$today .= gmdate( H:i:s). GMT;
return $today;
  }

$oneYear = NextYear();
header(Set-Cookie: CookieName=$CookieNameVar; path=/; expires=$oneYear);



This has never let me down, enjoy :)

Rick

 hi,
 i have a problem with cookie.
 
 true
 login page - decide page - main page
 |
  false 
 |
 login page
 
 username and password are posted by login page to decide page, if it's
 true, main page will be opened. when decide page is active, cookie is
 created by line setcookie(form, $value).
 but i've never seen the cookie file about it in windows\cookie
 directory. and sometimes cookie is created and sometimes not..
 
 and i didn't use any session, shall i use it for this work?
 what can i do about these problems?
 
 thanks
 
 
 -- 
 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]




Re: [PHP] Cookie problem

2001-09-20 Thread Murat

your header line works fine, but where are cookie files written?
i didn't see any cookie file about it in my windows/cookie directory 
after it had been created??

thanks

Richard Baskett wrote:

 Here use this cookie that I wrote, it works in every browser, every os.
 
 
 
 function NextYear () {
 $today  = gmdate(l, d-M-);
 $today .= gmdate(Y)+1;
 $today .= gmdate( H:i:s). GMT;
 return $today;
   }
 
 $oneYear = NextYear();
 header(Set-Cookie: CookieName=$CookieNameVar; path=/; expires=$oneYear);
 
 
 
 This has never let me down, enjoy :)
 
 Rick
 
 
hi,
i have a problem with cookie.

true
login page - decide page - main page
|
 false 
|
login page

username and password are posted by login page to decide page, if it's
true, main page will be opened. when decide page is active, cookie is
created by line setcookie(form, $value).
but i've never seen the cookie file about it in windows\cookie
directory. and sometimes cookie is created and sometimes not..

and i didn't use any session, shall i use it for this work?
what can i do about these problems?

thanks


-- 
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]




Re: [PHP] Cookie problem

2001-09-20 Thread Richard Baskett

It depends on which browser you are using and on what platform.  On the
MacOS in IE you can view cookies by going to Edit - Preferences - Cookies
in Netscape you can also view the cookies with the Preferences menu.  On the
PC it's a little more difficult.  In IE you go to Tools - Internet Options
- General [Tab] - Settings - View Files...  and then sort by file type,
go down to text files and you'll see all your cookies.  Now in Netscape I
think it's a little bit easier, but I am afraid I do not have netscape
currently on the pc machine (will get it soon) so I cant help you there, but
I do believe it's a lot easier.

In other words you can almost always view your cookies within the browser
application menus.

Rick

 your header line works fine, but where are cookie files written?
 i didn't see any cookie file about it in my windows/cookie directory
 after it had been created??
 
 thanks
 
 Richard Baskett wrote:
 
 Here use this cookie that I wrote, it works in every browser, every os.
 
 
 
 function NextYear () {
 $today  = gmdate(l, d-M-);
 $today .= gmdate(Y)+1;
 $today .= gmdate( H:i:s). GMT;
 return $today;
   }
 
 $oneYear = NextYear();
 header(Set-Cookie: CookieName=$CookieNameVar; path=/; expires=$oneYear);
 
 
 
 This has never let me down, enjoy :)
 
 Rick
 
 
 hi,
 i have a problem with cookie.
 
 true
 login page - decide page - main page
 |
 false 
 |
 login page
 
 username and password are posted by login page to decide page, if it's
 true, main page will be opened. when decide page is active, cookie is
 created by line setcookie(form, $value).
 but i've never seen the cookie file about it in windows\cookie
 directory. and sometimes cookie is created and sometimes not..
 
 and i didn't use any session, shall i use it for this work?
 what can i do about these problems?
 
 thanks
 
 
 -- 
 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 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] Cookie problem

2001-03-27 Thread Martin Skjöldebrand

Thanks everyone for all the responses.
I think I'll look into sessions in the future. Meanwhile I'll have to see 
what others come up with.

Thanks,

Martin S.

-- 
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] Cookie problem

2001-03-26 Thread Chris Lee

I have to agree Nuno, sessions are alot easier/simpler.


-- 

 Chris Lee
 [EMAIL PROTECTED]


"Nuno Silva" [EMAIL PROTECTED] wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

Hello,

short:
try removing the third parameter to setcookie and if the errors go away 
you know it's a cookie problem :)

long:
you're setting auth based in the (server's) time + 600sec. If the client 
(or even the server) has a clock skew... well bad luck :)
removing the third parameter makes php create a "session cookie" that 
will stay there until the browser is closed (alll the windows).
If this is not a problem, let it be. I love session cookies!! :)
Anyway, the best method to get decent auth are sessions. Try php4's 
sessions or phplib or something.

Regards,
Nuno


Martin Skjldebrand wrote:

 I'm experiencing all kinds of problems with, what we suppose is the cookie 
 setting. This is the code:
 
 if (isset($authentication)) {
   setcookie("status", $status, time()+600);
   setcookie("user", $user, time()+600);
   setcookie("group", $group, time()+600);
   setcookie("authentication", $authentication, time()+600);
   setcookie("laston", $laston, time()+600);
 }
 else {
   setcookie("status", "Logged In", time()+600);
   setcookie("user", $txtUsername, time()+600);
   setcookie("group", $row[4], time()+600);
   setcookie("authentication", "YES", time()+600);
   setcookie("laston", $row[6], time()+600);
 }
 
 (I have not coded this).
 
 What seems to happen is that - with alarming regularity - people are 
 getting logged off when choosing item from a menu. Either they are thrown 
 out into the log on-screen or (as has happened to me recently) the app 
 simply states I'm not logged on even if I am in the middle of using it (and 
 must have logged on).
 
 I'm not at all familiar with cookies (yet) but suspect that the timing of 
 the critters could be a culprit. IS this correct?
 How do I solve the problem?
 
 M.


-- 
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]