[PHP] Re: cookie ( still not working )

2002-07-11 Thread Richard Lynch

>i simpley put an cookie with : 
>
>setcookie("gfo_cms" ,$sessid , ''); 

That's wrong.

You should be passing a TIME in for the third argument, or nothing at all.

Also, due to an IE bug, if you *DO* pass in a TIME, you *MUST* also pass in
a non-empty path.

'/' will be fine.

So, if you want a 'session' Cookie, use:

setcookie('gfo_cms', $sessid);

If you want it to expire, use:

setcookie('gfo_cms', $sessid, time() + 60*60*24*30, '/');

Oh, and for Vins, PHP sessions *USE* cookies, so you're no better off with
them *UNLESS* you --enable-trans-sid or you stuff the session_id() into
every URL/FORM.

>
>if (isset($HTTP_COOKIE_VARS["gfo_cms"])) {
>   $sessid = $HTTP_COOKIE_VARS["gfo_cms"];
>   if (!check_valid_sessid($sessid)) {
>login_form();
>   }
>   if (!check_ip($sessid, $REMOTE_ADDR)) {
>login_form();
>   }
>   $rights = get_user_rights($sessid);
>   $user_id = get_userid_from_sessid($sessid); 
>
>}

This might as well be "else" -- it will be less cluttered that way.

>if (!isset($HTTP_COOKIE_VARS["gfo_cms"])) {
>login_form();
>  } 
>
>?> 
>
>the last code looks if the cookie exists ...
>but it look likes it won't even create the cookie 

Use your browser Preferences to select Cookie "Ask every time" so that when
you do or don't send a Cookie from your own site, you'll know what you're
getting.

You'll want to turn it off before real surfing again, though, since some
sites send a zillion cookies on every damn page, no matter how silly that
is.  Sigh.

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




[PHP] Re: cookie ( still not working )

2002-07-10 Thread vins

My experience with cookies is really unhappy.
I've once developed a website that needed to store information.
I though hey cookies are the quicker option to hell with sessions.

Now today after all of my problems with the cookies environment i've
turned back to sessions.
Sessions can store a much higher amount of data... and that doesn't have to
rely on the client browser either.

I mean if i visit a site that needs to have cookies enabled... i'm pretty
stuffed I can't see nothing
but if the site uses sessions dam i'm organized

If you feel you have too many problems with cookies refer back to
sessions
it's the best option... well that i've come down to.


"Richard Mail" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> my cookie problem is still not solved :(
> my browser settings are correct, and the script has worked.
>
> but sins i now installed php 4.2.1 with apache 1.3.24 it doesn't work :(
>
> does any one have an solution ??
>
> thnx in advance,
>
> Richard



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




[PHP] Re: cookie ( still not working )

2002-07-10 Thread richard . mail

Johan Holst Nielsen writes: 

> 
>> my cookie problem is still not solved :(
>> my browser settings are correct, and the script has worked.
>> but sins i now installed php 4.2.1 with apache 1.3.24 it doesn't work :(
>> does any one have an solution ??
>> thnx in advance,
>  
> 
> Sure about your register_globals = off? 
> 
> please show us the source, or a link to at phps file...
> And a link to a phpinfo() file? 
> 
> I cant help you without further information! 
> 
> Regards,
> Johan 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php 
> 
the setting in php.ini : 

register_globals = on 

i simpley put an cookie with : 

setcookie("gfo_cms" ,$sessid , ''); 


and i read it with : 

 

 

the last code looks if the cookie exists ...
but it look likes it won't even create the cookie 

an idea's ?

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




[PHP] Re: cookie ( still not working )

2002-07-10 Thread Johan Holst Nielsen

> my cookie problem is still not solved :(
> my browser settings are correct, and the script has worked.
> but sins i now installed php 4.2.1 with apache 1.3.24 it doesn't work :(
> does any one have an solution ??
> thnx in advance,


Sure about your register_globals = off?

please show us the source, or a link to at phps file...
And a link to a phpinfo() file?

I cant help you without further information!

Regards,
Johan


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