Re: Setcookie problem in ie 5.0

From: Date: Tue, 12 Dec 2000 22:21:30 +0000
Subject: Re: Setcookie problem in ie 5.0
Groups: php.general 
Request: Send a blank email to php-general+get-29862@lists.php.net to get a copy of this message
Thanks Georges and everybody else who responded. I finally got it to work both in IE5.0 and NS4.5. Yoohoo!!!! :) The thing I used was META tags with HTTP-EQUIV=Set-Cookie and HTTP-EQUIV=REFRESH. Here's my code if anybody else faces the same in the future: $expiretime=mktime()+3600; $date = date("l, d-M-y H:i:s", ($expiretime)); echo "<meta http-equiv=\"Set-Cookie\" content=\"per_db_id=$per_id; expires=$date GMT; path=/\">"; echo "<meta http-equiv=\"Set-Cookie\" content=\"per_db_lname=$per_lname; expires=$date GMT; path=/\">"; echo "<meta http-equiv=\"Set-Cookie\" content=\"per_db_fname=$per_fname; expires=$date GMT; path=/\">"; echo "<meta http-equiv=\"Refresh\" content=\"0;URL=$reflink\">"; Rustam. -----Original Message----- From: Georges da Mata Claessen <georges@embrapa.br> To: Rustam Nabirov <r_nabirov@kazakhstan-gateway.org>; php-general@lists.php.net <php-general@lists.php.net> Date: 12 äåêàáðÿ 2000 ã. 6:01 Subject: Re: [PHP] Setcookie problem in ie 5.0 >I'm sending the code I used to authenticate the cookie. It worked >properly here... > >$valor = 26262525 > setcookie("projeto_plataforma_rtv",$valor,time()+5400); > >And after on the authentication page you must verify it the cookie is >set like this... > >if (!isset($projeto_plataforma_rtv)) > >You can consult the PHP documentation too... > >Rustam Nabirov wrote: > >> >You must set a cookie at one page and send the user to another page >> so that the >> >browser can recognize the cookie, it's strange but it works. Making >> that way, >> >you would have a first screen with the login, a second page to >> authenticate the >> >user and a third page with your aplication. The second page would >> redirect the >> >user to the third. (Its functions would be set the cookie and >> redirect the >> >user). >> > >> >Georges.I'm afraid, Georges, it doesn't work either. I still don't >> see any cookies saved. Somehow the browser accepts the variables after >> the redirection and uses them to display a greeting message (works >> only in IE 5.0, not in Netscape :-( another headache), however, if I >> close the browser window and open a new one with the page which the >> authentication script redirects the browser to, no greeting message >> appears (though it's supposed to), which means there's NO cookie. I'm >> so frustrated! Can somebody help with this thing? I tried to use >> JavaScript with its windows.location instead of PHP's Header >> ("Location"). Still no luck. >Rustam Nabirov wrote: >> > >> >> I'm using IE5.0 on Win98, it's as simple as it gets. But still I >> don't see >> >> any cookies saved. As far as I understand, on this platform cookies >> get >> >> saved in C:\WINDOWS\Cookies, and C:\WINDOWS\Temporary Internet >> Files has >> >> only shortcuts to those cookies. >> >> >> >> -----Original Message----- >> >> From: Cynic <cynic@mail.cz> >> >> To: Rustam Nabirov <r_nabirov@kazakhstan-gateway.org>; >> >> php-general@lists.php.net <php-general@lists.php.net> >> >> Date: 7 ??????? 2000 ?. 8:50 >> >> Subject: Re: [PHP] Setcookie problem in ie 5.0 >> >> >> >> >Location of cookie files is system specific. On my NT5 Pro it's >> >> > >> >> >C:\Documents and Settings\%Account%\Local Settings\Temporary >> Internet Files >> >> > >> >> >At 00:35 8.12. 2000, Rustam Nabirov wrote the following: >> >> >-------------------------------------------------------------- >> >> >>I'm using a login script which sets a cookie and redirects the >> browser >> >> using >> >> >>"header ("Location")". The page which the browser gets >> >> >>redirected >> to >> >> fetches >> >> >>cookie values and uses it to identify users. The expiration time >> is 1 >> >> hour. >> >> >>The script seems to be working fine, however, I don't see any >> cookies >> >> saved >> >> >>either in C:\WINDOWS\Cookies or C:\WINDOWS\Temporary Internet >> Files >> >> >>I'm not sure if this might cause any problem in the future. >> >> >>I don't want to spend a heck of time creating scripts just to >> find out >> >> later >> >> >>that some was wrong in this setcookie routine. Has anyone faced >> the same >> >> >>thing before? >> >> >> >> >> >>Thanks in advance, >> >> >>Rustam. >> >> >> >> >> >>This is a part of the script: >> >> >> >> >> >>$expiretime=time()+3600; >> >> >>$date = date("l, d-M-y H:i:s", ($expiretime)); >> >> >>setcookie ("per_db_id","$per_id","$date >> GMT","/","www.domainname.com",0); >> >> >>setcookie ("per_db_fname","$per_fname","$date >> >> >>GMT","/","www.domainname.com",0); >> >> >>setcookie ("per_db_lname","$per_lname","$date >> >> >>GMT","/","www.domainname.com",0); >> >> >>header ("Location: $reflink"); >> >> >> >> >> >> >> >> >> >> >> >>-- >> >> >>PHP General Mailing List (http://www.php.net/) >> >> >>To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >> >> >>For additional commands, e-mail: php-general-help@lists.php.net >> >> >>To contact the list administrators, e-mail: >> php-list-admin@lists.php.net >> >> >------end of quote------ >> >> > >> >> > >> >> > >> >> >____________________________________________________________ >> >> >Cynic: >> >> > >> >> >A member of a group of ancient Greek philosophers who taught >> >> >that virtue constitutes happiness and that self control is >> >> >the essential part of virtue. >> >> > >> >> >cynic@mail.cz >> >> >ICQ: 2808 2505 >> >> > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> >-- >> >> >PHP General Mailing List (http://www.php.net/) >> >> >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >> >> >For additional commands, e-mail: php-general-help@lists.php.net >> >> >To contact the list administrators, e-mail: >> php-list-admin@lists.php.net >> >> > >> >> > >> >> >> >> -- >> >> PHP General Mailing List (http://www.php.net/) >> >> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >> >> For additional commands, e-mail: php-general-help@lists.php.net >> >> To contact the list administrators, e-mail: >> php-list-admin@lists.php.net >> > >> > >

« previous php.general (#29862) next »