php session doesn't work

A

Anonymous

Guest
Hi!

Perhaps it will not change anything, but if I were you, I would use $_SESSION instead of session_register...

Otherwise and in any case, define your variables before calling session_register...

/Flood
 
spotty said:
Hello,
<?php
@session_start();
session_register('userName', 'userPermissions');
$userName = 'hallo';
$userPermissions = 'no';
?>

Usin this method you need to define the variables before you register them i.e.
Code:
<?php
@session_start();
$userName        = 'hallo';
$userPermissions = 'no';
session_register('userName', 'userPermissions');
?>

As flood suggests using $_SESSION is not only easier to understand but there is less code. less code means less typing. less typing means less chance for typo's means less trouble debugging.
 
Back
Top