Re: [PHP] PHP Sessions

[email protected] (Kevin Kinsey)
Newsgroups php.general
Message-ID <[email protected]>
Martine Osias wrote:
> Hi:
> 
> I need to store variables to send then between pages. I don't need the 
> variables in a database so I try to send them with sessions. The 
> variables don't seem to be there when I try to get them. What could be 
> the problem. Here are the pages where I store and retrieve the variables.
> 
> Page 1 (variables stored):
> 
> <?php
> 
> session_start();
> 
> $_SESSION['scripture_text']  = $row_scripture['ScriptureText'];
> $_SESSION['scripture_ref']  = $row_scripture['ScriptureRef'];

Do sessions work at all?  Something simple, like

****************************
<?php
//a.php

session_start();
$_SESSION['test']="foo";
echo '<a href="b.php">Click me</a>';
?>

<?php
//b.php

session_start();
echo $_SESSION['test'];  // should say "foo"
?>
*************************

      ... would be a good 1st test.

If that works, I'd suspect that $row_scripture['ScriptureText']
and friends are empty.

If it doesn't, I'd suspect a combination of very strict
browser privacy settings (disallow all cookies) with lame server
config (use_only_cookies), or that session support is missing
or disabled.

HTH,

KDK
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.