PHP Session Variables and smarty Templates

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brennan Mann

    PHP Session Variables and smarty Templates

    Hello, I am having problems updating PHP session variables. I can set
    them and see them using the following debug print_r($_SESSI ON); Once,
    I start using smarty templates, I cannot modify the PHP session
    variables. Does smarty tags overwrite or disable PHP session vars?


    session_name("S hoppingCartUser Session");
    session_start() ;
    session_registe r("iwsUsername" );
    session_registe r("iwsFirstName ");
    session_registe r("iwsAdminLogi n");
    $_SESSION["iwsUsernam e"] = "Brennan";


    Once I hit the smarty template

    $smarty->display("index .html");

    The session variable is now static for the entire session:
    $_SESSION["iwsUsernam e"]

    I can no longer modify and of the PHP session variables. I am not
    using any PHP header/location redirects.

    Any insight would be greatly appreciated.

    Thanks,
    Brennan
  • petersprc

    #2
    Re: PHP Session Variables and smarty Templates

    It may be a caching issue. Try setting
    session_cache_l imiter('nocache ').

    Check out the response headers using Live HTTP Headers for FF:



    Regards,

    John Peters

    On Apr 13, 3:50 pm, Brennan Mann <brennan.m...@g mail.comwrote:
    Hello, I am having problems updating PHP session variables. I can set
    them and see them using the following debug print_r($_SESSI ON); Once,
    I start using smarty templates, I cannot modify the PHP session
    variables. Does smarty tags overwrite or disable PHP session vars?
    >
    session_name("S hoppingCartUser Session");
    session_start() ;
    session_registe r("iwsUsername" );
    session_registe r("iwsFirstName ");
    session_registe r("iwsAdminLogi n");
    $_SESSION["iwsUsernam e"] = "Brennan";
    >
    Once I hit the smarty template
    >
    $smarty->display("index .html");
    >
    The session variable is now static for the entire session:
    $_SESSION["iwsUsernam e"]
    >
    I can no longer modify and of the PHP session variables. I am not
    using any PHP header/location redirects.
    >
    Any insight would be greatly appreciated.
    >
    Thanks,
    Brennan

    Comment

    Working...