Jump to content

[SOLVED] $_SESSION only work on my computer =(


clown[NOR]

Recommended Posts

Hi again =)

 

well now I've tried out the $_SESSION instead of $_COOKIE for remembering name and URL in my shoutbox...

it works perfectly fine on my computer, but I tried it on my fiance's computer and it didn't work.. I added the print_r($_SESSION) to the top of my index file. on my computer it show's all the sessions as they should be, but on my fiance's comptuer it only show's Array()

 

<?php
if (isset($_SESSION['sbname'])) {
	if ($_SESSION['sbname'] != $_REQUEST['sbname']) {
		$_SESSION['sbname'] = $_REQUEST['sbname'];
	}
	if ($_SESSION['sburl'] != $_REQUEST['sburl']) {
		$_SESSION['sburl'] = $_REQUEST['sburl'];
	}
} else {
	$_SESSION['sbname'] = $_REQUEST['sbname'];
	if (isset($_REQUEST['sburl'])) { $_SESSION['sburl'] = $_REQUEST['sburl']; }
}
?>

Link to comment
https://forums.phpfreaks.com/topic/46046-solved-_session-only-work-on-my-computer/
Share on other sites

yes...

 

index.php

<?php 
session_start();

if (isset($_SESSION['sbname'])) { $sbname = $_SESSION['sbname']; }
if (isset($_SESSION['sburl'])) { $sburl = $_SESSION['sburl']; }
?>

 

shout.php

<?php
session_start();	
$phps_sbname = $_REQUEST['sbname'];
$phps_sburl = $_REQUEST['sburl'];
$phps_sbmessage = $_REQUEST['sbmsg'];

if (isset($_SESSION['sbname'])) {
	if ($_SESSION['sbname'] != $_REQUEST['sbname']) {
		$_SESSION['sbname'] = $_REQUEST['sbname'];
	}
	if ($_SESSION['sburl'] != $_REQUEST['sburl']) {
		$_SESSION['sburl'] = $_REQUEST['sburl'];
	}
} else {
	$_SESSION['sbname'] = $_REQUEST['sbname'];
	if (isset($_REQUEST['sburl'])) { $_SESSION['sburl'] = $_REQUEST['sburl']; }
}
?>

 

at the top of my site it show:

Array ( [login] => ok [user] => ******** [sbname] => Clown [sburl] => http://www.phpschool.co.nr/ )

 

but at my fiance's it show:

Array (  )

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.