![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 14 Pomógł: 0 Dołączył: 17.10.2007 Ostrzeżenie: (0%) ![]() ![]() |
Witam
Mam taki problem. Otóż przy ustawianiu cookies (strona logowania - powiedzmy www.mojadomena.pl/Login/Check.html) ciasteczko jest widoczne poprawnie. Natomiast jeśli po przejściu na stonę www.mojadomena.pl ( header("Location: www.mojadomena.pl")) ciasteczka nie ma. Dajcie mi jakieś namiary co może być nie tak bo już siedze nad tym 3 dzień. Pozdrawiam |
|
|
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 2 291 Pomógł: 156 Dołączył: 23.09.2007 Skąd: ITALY-MILAN Ostrzeżenie: (10%) ![]() ![]() |
Moze kod zapodasz wrozka o tej porze juz spi
![]() -------------------- Zainteresowania: XML | PHP | MY(SQL)| C# for .NET | PYTHON
http://code.google.com/p/form-builider/ Moj blog |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 14 Pomógł: 0 Dołączył: 17.10.2007 Ostrzeżenie: (0%) ![]() ![]() |
Oto kod:
Plik Login: CODE protected function CheckLogin(){ $login = $_POST["login"]; $password = $_POST["password"]; if(empty($login) || empty($password)){ $this->lastError = "Musisz wypełnić obydwa pola"; return; } $login = htmlspecialchars($login); $login = mysql_escape_string($login); $this->siteCore->Auth()->CheckLogin($login, $password); if($this->siteCore->Auth()->IsAuthorizated()){ header('Location: '. $this->siteCore->GetURL()); }else{ $this->lastError = "Błąd autoryzacji"; } } Plik z funkcja Auth() CODE $login = htmlspecialchars($name); $login = mysql_escape_string($login); $sql = "SELECT * FROM tb_users WHERE Login = '".$login."'"; //pobieranie danych z bazy ... if(strcmp(trim($res[0]["pm_Password"]),md5(trim($password))) == 0){ $this->userData = new UserData(); $this->userData->userName = $res[0]["pm_Login"]; $this->userData->userPassword = $res[0]["pm_Password"]; $this->userData->userRights = $res[0]["pm_Rights"]; $this->userData->userTypedPassword = trim($password); $this->userData->userEmail = $res[0]["pm_Email"]; setcookie ("TestCookie", serialize($this->userData), 0); } I jak już wspomniałem po wykonaniu tego kodu i przejściu na stronę główną nie widzi ciasteczka. Co ciekawe ciasteczko jest jeśli pozostaje na danej podstronie (czyli nie wykonam header('Location: '. $this->siteCore->GetURL()) ![]() |
|
|
![]()
Post
#4
|
|
![]() Grupa: Moderatorzy Postów: 2 921 Pomógł: 269 Dołączył: 11.08.2005 Skąd: 127.0.0.1 ![]() |
Ustaw ścieżkę w setcookie na / - czwarty parametr.
Ustawiając ciacho w ścieżce /Login, nie jest ono widoczne w ścieżce / i stąd Twoje problemy. -------------------- I would love to change the world, but they won't give me the source code.
My software never has bugs. It just develops random features. |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 6.07.2025 - 23:56 |