Ada yang tau soal Cookies?


Status
Not open for further replies.

rudyjog

Beginner 1.0
Selamat pagi semua. Mohon masukan dari teman2.
Website saya saat ini muncul error message seperti ini :
Warning: session_start() [function.session-start]: open(/path/sess_1a23e6a24f1a64cc1b5b89a70d6c1bcb, O_RDWR) failed: No such file or directory (2) in /home/uangkage/public_html/sponsor.php on line 4

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/uangkage/public_html/sponsor.php:4) in /home/uangkage/public_html/sponsor.php on line 4

Apa ada yg tau gimana cara memperbaikinya? Apakah setting cookie dari administrator berpengaruh terhadap akses website? Di web saya setting cookie saat ini 30 hari, apakah itu masalahnya?
Please help me.....
 

frozts91

Poster 2.0
Warning: session_start() [function.session-start]: open(/path/sess_1a23e6a24f1a64cc1b5b89a70d6c1bcb, O_RDWR) failed: No such file or directory (2) in /home/uangkage/public_html/sponsor.php on line 4
tidak ada file sessionnya kalau ini.

kalau yang ini
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/uangkage/public_html/sponsor.php:4) in /home/uangkage/public_html/sponsor.php on line 4
biasanya terjadi dimana script yang harus nya membutuhkan sesi pertama untuk menyimpan suatu sesi di web browser kedahuluan oleh sesi yang dihasilkan sciprt lain. solusinya coba dituker tempat saja. :)

kalau boleh bisa disertain code php dari sponsor.php, biar saya bisa tahu
 

rudyjog

Beginner 1.0
cara tuker t4 gmn bro?
ini code dari sponsor.php web saya :
<?php
include("globals.php");

session_start();

$sponsor_level1_cookie = $HTTP_COOKIE_VARS['level1'];
$random_sponsor_cookie = $HTTP_COOKIE_VARS['rsponsor'];





$cookie_expired = time() + $conf['expires'] * 60 * 60 * 24 ;


if (session_is_registered("sponsor_level1") and session_is_registered("random_sponsor")) {

if (isset($id)) {
if (read_aktif($id)) {

setcookie ("level1", $id, $cookie_expired);

$sponsor_level1 = $id;
write_stats($id);
} else {
$sponsor_level1 = make_sponsor();
setcookie ("level1", $sponsor_level1, $cookie_expired);
}


}
return true;
} else {


if (isset($sponsor_level1_cookie)) {
if (read_aktif($sponsor_level1_cookie)) $sponsor_level1 = $sponsor_level1_cookie;
else
{
$sponsor_level1 = make_sponsor();
setcookie ("level1", $sponsor_level1, $cookie_expired);
}
} else {
$sponsor_level1 = make_sponsor();
setcookie ("level1", $sponsor_level1, $cookie_expired);
}


if (isset($id)) {
if (read_aktif($id)) {

setcookie ("level1", $id, $cookie_expired);

$sponsor_level1 = $id;
write_stats($id);
} else {
$sponsor_level1 = make_sponsor();
setcookie ("level1", $sponsor_level1, $cookie_expired);
}
}



if ($conf['rsponsor'] == 1) {


if (isset($random_sponsor_cookie)) {
if (read_aktif($random_sponsor_cookie)) $random_sponsor = $random_sponsor_cookie;
else
{
$random_sponsor = make_sponsor();
setcookie ("rsponsor", $random_sponsor, $cookie_expired);
}
} else {
$random_sponsor = make_sponsor($sponsor_level1);
setcookie ("rsponsor", $random_sponsor, $cookie_expired);
}


if ($sponsor_level1 == $random_sponsor) {
$random_sponsor = make_sponsor($sponsor_level1);
setcookie ("rsponsor", $random_sponsor, $cookie_expired);
}
}


session_register("sponsor_level1");
session_register("random_sponsor");
}



function make_sponsor($except = '') {
global $conf;
srand((double)microtime() * 10000000);
$qdb = "SELECT * FROM members WHERE `userlevel`='1' AND `userid` != '$except' ORDER BY RAND()";

$qres = mysql_db_query($conf['dbname'], $qdb) or display_html(mysql_error(), "error.html");
if (mysql_num_rows($qres)) {

$out = array();
while ($row = mysql_fetch_array($qres)) {

$i = 1;
while ($i < $row['rotation']) {
$out[] = $row['userid'];
$i++;
}
}
$rand_keys = array_rand($out, 1);
$sponsor = $out[$rand_keys];
}

return $sponsor;
}

?>
 

rudyjog

Beginner 1.0
itu karena variabel session.save_path-nya kosong atau salah, tentuin/definisikan dalam script tsb atau lewat php.ini atau htaccess
caranya saya harus ketik apa di htaccess? saya masih awam nih soal ginian.
ini code htacces saya :
# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName uangkaget.biz
AuthUserFile /home/uangkage/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/uangkage/public_html/_vti_pvt/service.grp
php_flag register_globals on
 

ruangweb

(Ret) Community Leader
tambahin ini (ini hanya efektif kalo php terpasang sebagai modul apache)
Code:
php_value session.save_path "/home/[I]namauser[/I]/[B]ganti/ini/dgn/lokasi/yang/benar[/B]"
 

rudyjog

Beginner 1.0
tambahin ini (ini hanya efektif kalo php terpasang sebagai modul apache)
Code:
php_value session.save_path "/home/[I]namauser[/I]/[B]ganti/ini/dgn/lokasi/yang/benar[/B]"
Sudah saya coba bos. Tapi tetap muncul error message ini :
Warning: session_start() [function.session-start]: open(/home/uangkage/public_html/sess_b0c39b997b37447456ba3506fe2da019, O_RDWR) failed: Permission denied (13) in /home/uangkage/public_html/sponsor.php on line 4

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/uangkage/public_html/sponsor.php:4) in /home/uangkage/public_html/sponsor.php on line 4

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/uangkage/public_html/sponsor.php:4) in /home/uangkage/public_html/sponsor.php on line 4

Warning: Cannot modify header information - headers already sent by (output started at /home/uangkage/public_html/sponsor.php:4) in /home/uangkage/public_html/sponsor.php on line 45
 
Status
Not open for further replies.

Top