Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
zasto se cookie ne sprema na odredjenom serveru?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.10.2005 14:32    Post subject: zasto se cookie ne sprema na odredjenom serveru? Add user to your forum ignore list Reply with quote

EDIT // false alarm.. :]

napominjem da login skripta radi bez greske na mom site-u, ali kad smo sve preselili na server od faksa (namjestili sve permissione) jednostavno se nemos logirat nikako. pojavi se prazna stranica, kliknem refresh, baca me opet na login.

ovako izgleda spremanje cookie-ja
Code:
function store_key($key, $userid) {
   setcookie('AUTHKEY', $key);
   $keyfile = '../tmp/authkey_' . $key;
   if(file_exists($keyfile))
      return false;
   $fp = fopen($keyfile, 'w');
   if (!(fwrite($fp, $userid)))
      return false;
   fclose ($fp);
   return true;
}

ovaj authkey na serveru se zapise, provjerili smo, login uspije jer mi skripta zapisuje log file kad god se netko pokusa logirat... jedini moguci problem je onda u tom kukiju.

koji kuki?!? Evil or Very Mad

P.S. ako kome ista znaci, ovo je php info: http://www.riteh.hr/~ndunato/racunala1/test.php

Last edited by nel`chee on 21.02.2006 22:30; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website Twitter profile
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 31.10.2005 14:39    Post subject: Add user to your forum ignore list Reply with quote

jedno pitanje...sta ti tocno ovo provjerava? i zasto?

Code:
if(file_exists($keyfile))
      return false;

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.10.2005 14:46    Post subject: Add user to your forum ignore list Reply with quote

erm... pa nekako pretpostavljam da je to osiguranje kako se ne bi isti key upisao za vise usera, znaci da se svaki put generira drugaciji key, inace ce login fejlati.

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 31.10.2005 14:50    Post subject: Add user to your forum ignore list Reply with quote

da, ali svejedno useru stisne cookie bez obzira postoji li file ili ne...tak da bi ti tu moglo pucati...a uz to probaj cookie definirati sa nekim lifetimeom jer mozda ti je defaultni cookie lifetime 0

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 31.10.2005 14:53    Post subject: Add user to your forum ignore list Reply with quote

Pa pogledaj dobije li klijent ikakav kuki ili ne dobi...
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.10.2005 14:58    Post subject: Add user to your forum ignore list Reply with quote

pa ne zapise se, to i govorim!

kad se logiram na svom serveru, pojavi mi se cookie AUTHKEY sa tim key-em.
kad se logiram na serveru od faklsa, nikakvog cookie-a nema, i sad mene zanima zasto!

retro: ako funkcija vrati false, djabe da se cookie i zapisao, kad bi korsnika...hm... ma dobro, idem izbrisat tu liniju pa vidjet sta ce se dogodit.

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.10.2005 15:03    Post subject: Add user to your forum ignore list Reply with quote

obrisala, nista se nije promijenilo Sad

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 31.10.2005 15:05    Post subject: Add user to your forum ignore list Reply with quote

1. probaj napravit
Code:

if(setcookie('AUTHKEY', $key) == false))
{
    echo 'bla';
}


tak da znas dal ga server uopce uspije poslat

ako to radi

2. odmah nakon sto setiras cookie probaj isprintat njegovu vrijednost da vidis dal ga je klijent primio, ali mu mozda cookie expirea odmah nakon zavrsetka skripte

u svakom slucaju ja bi eksplicitno definirao cookie lifetime, ako zbog niceg drugog zbog securitya

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.10.2005 15:10    Post subject: Add user to your forum ignore list Reply with quote

nije ga poslao.

e na koliko onda da ga odredim? mislim, stajaznam koliko ce tipu trebat da napise sve sta mu treba, glupo da napise cijelu stranicu obavijesti i onda mu session istekne kad pokusa postat... to zelim izbjec.

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 31.10.2005 15:13    Post subject: Add user to your forum ignore list Reply with quote

pa stavi sat - dva...sta ja znam..ovisi kolko brzo lik pise Smile

posto ti ne salje cookie, provjeri postoji li mogucnost da je server poslao neki output prije toga...jer onda cookie automatski faila...za pocetak bi na pocetak skripte puknuo ob_start(); a na kraj ob_end_flush();

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.10.2005 15:17    Post subject: Add user to your forum ignore list Reply with quote

mmmk...

e na pocetak i na kraj koje skripte, ove za autorizaciju? ovaj auth file se inlcuda u index, i poziva se svaki put, prije toga u indexu imam
Code:
ini_set('display_errors','0');

naravno, nakon skripte tu se ncluda content... pa reci na koji pocetak i kraj si mislio Smile

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 31.10.2005 15:19    Post subject: Add user to your forum ignore list Reply with quote

na pocetku index fajle prije bilo cega i daj zakomentiraj ovi ini_set... liniju zasad

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.10.2005 15:26    Post subject: Add user to your forum ignore list Reply with quote

weeeeeeeeeeeee Very Happy radi radi radi!!

evo ocito su te ob_...(); funkcije rijesile stvar Very Happy

hvala retro

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 31.10.2005 15:27    Post subject: Add user to your forum ignore list Reply with quote

eto...zakon Very Happy

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 31.10.2005 23:43    Post subject: Add user to your forum ignore list Reply with quote

Očito imaš neki output browseru prije postavljanja cookia, dovoljan je i jedan razmak ispred "<?php" da sve padne u vodu, ja bi hna tvom mjestu ipak potražio problem... Ne treba stvari samo krpati, barem ne na početku projekta Smile
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 01.11.2005 00:20    Post subject: Add user to your forum ignore list Reply with quote

ma pogledala sam, bas nema nicega... osim ako je BOM na tom mjestu, a bila sam uvjerena da sam ih sve makla Confused

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 01.11.2005 02:57    Post subject: Add user to your forum ignore list Reply with quote

gog wrote:
Ne treba stvari samo krpati, barem ne na početku projekta Smile


pa output buffer funkcije nisu krpanje....one ti samo pojednostavljuju zivot da ne moras paziti previse kad sto outputas...i ja ih koristim uvijek...bas zato da izbjegnem bezvezna pucanja

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
gog



Joined: 18 Jun 2004
Posts: 679
Location: zagreb

PostPosted: 01.11.2005 10:49    Post subject: Add user to your forum ignore list Reply with quote

Pa meni u ovom slučaju jesu, jer su stavljene jer nešto iz nepoznatog razloga nije radilo. Nema veze, ja sam samo picajzlasta osoba u nekim stvarima Smile
Back to top
View user's profile Send private message Visit poster's website
retro_one



Joined: 16 Sep 2003
Posts: 880
Location: DUBRAVA.

PostPosted: 01.11.2005 11:24    Post subject: Add user to your forum ignore list Reply with quote

hm...ako je radilo na normalnom serveru....a ne radi na serveru od faksa...rekao bi da je problem u serveru...posto se za taj server vjerojatno brine i odrzava ga netko kome odrzavanje servera nije 24/7 posao...i ne zna ga mozda setirati drito kak bi trebalo...i kak je na vecini servera.

_________________
Just your average eccentric programmer.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group