Because of security reasons, register_globals
is set to off.
And that sucks, because right now I could really have use of sessions.
How do you guys solve this "problem"?
UPDATE
I have tried using $_SESSION, but it's not working. That's why I thought it had something to do with register_globals
being off.
In my header file, I have the following code:
session_start();
if (!isset($_SESSION['test'])) {
$_SESSION['test'] = "Foo bar";
Now, anywhere in my header file, I can output the content of $_SESSION['test']
.
But I'm not able to output the same content from e.g. page.php file.
Here is an example using Wordpress: example.php
//Include the header file
<?php get_header(); ?>
Here is some text, and this is my session: <?php echo $_SESSION['test']; ?>
<?php get_footer(); ?>
This will result in an empty Session.