Re: PHP Sessions
| From: | Kevin Kinsey | Date: | Sat, 13 Mar 2010 01:13:02 +0000 |
| Subject: | Re: PHP Sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-302763@lists.php.net to get a copy of this message | ||
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