Should a session variable work, if used in an include file?
i.e. I set session_start(); in the first line of the main page.

In the include file, I check if the session variable is set.
if (isset($_SESSION['search']))
{
  $search = $_SESSION['search'];
}
then check for normal characters.

In the last line of the include file, I pass the session back.
$_SESSION['search'] = $search;

This works locally on my computer, but not on the server.
I've moved the session variables to the main page now, and it works.

Is this normal for sessions not to work in included pages, or is my server 
setup differently?
$_POST and $_GET work in included files, so why shouldn't $_SESSION
Thanks, Bob.




Please remember to write your response BELOW the previous text. 

Community email addresses:
  Post message: php-list@yahoogroups.com
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/php-list/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to