Forum Moderators: coopster

Message Too Old, No Replies

sessions and redirects

         

bleak26

7:30 pm on Dec 21, 2005 (gmt 0)

10+ Year Member



Hi

I use the following code to create session then store a session variable called query and then redirect to another page called insertaccount.php where i wish to use the
session value query. when i get to insertaccount.php the session variable query does not exist.can any one tell me why this is.

page1.php
<php?
session_start();
$_SESSION['query'] = $query;
header("Location: [127.0.0.1...]
?>

insertaccount.php
//inside
<?php
session_start();
$sql_query = $_SESSION['query'];
?>

FalseDawn

7:45 pm on Dec 21, 2005 (gmt 0)

10+ Year Member



Try:
header("Location: [127.0.0.1...]
session_write_close();
exit();

If that doesn't work - are cookies enabled, allowing the propagation of the session ID? You might have some trouble with the way you are using 127.0.0.1 in the URL with cookies, too.