You are here: Re: Passing session variables across pages « PHP Programming Language « IT news, forums, messages
Re: Passing session variables across pages

Posted by FrobinRobin on 05/08/07 09:39

Have you thought that you are using header() to forward to http://example.com
but are coming from http://www.example.com?

When bizarre things like this happen, I would print out the whole
$_SESSION variables to see what is contained in it.
Just use this code at different points in your scripts:


echo "This is the 'blah' point"
echo "<pre>";
print_r($_SESSION);
echo "</pre>";

I would also remove the header() function and use a manual link to see
if you have made a mistake with the function.

I ALWAYS use a custom session name and the output buffer .. sometimes
I need to refresh the page to see the sessions, does refreshing
produce any results? (stupid question but I have to ask!)

Here is the code I use at the start and end of ALL my sites:

<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
session_name("your_custom_session_name,");
session_start();
ob_start();
?>

// html header tags
// site body

<?php
ob_end_flush();
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация