creating own session_id

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ceanth
Forum Newbie
Posts: 1
Joined: Tue Jul 08, 2003 3:19 pm
Location: London

creating own session_id

Post by ceanth »

Hi all, i have created my own session_id which displays on the page fine. I have used:

<?

if (session_id()) {
echo "session has started.";
}
else{

$time = time();
$date = $today = date("Ymd");
$id = $time + $date;

session_id($id);
session_start();
session_register(session_id);

print session_id();
echo "time = $time";
echo "date = $date";
}
?>

This works fine and if u add time + date u get session_id (which is what i want)

Ok now for a test i linked this to another page, a simple html link and for the next page i tried displaying the session_id again to see if the value from the first page sent to the second page. The coding i used was:

<?
session_start();
print session_id();

?>

But the session_id doest not seem to be passing. Im an newbie at php so it might be something simple i missed.

Thanks

ceanth
Post Reply