473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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($_SESSION); Once,
I start using smarty templates, I cannot modify the PHP session
variables. Does smarty tags overwrite or disable PHP session vars?
session_name("ShoppingCartUserSession");
session_start();
session_register("iwsUsername");
session_register("iwsFirstName");
session_register("iwsAdminLogin");
$_SESSION["iwsUsername"] = "Brennan";
Once I hit the smarty template

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

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

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
Jun 2 '08 #1
1 8554
It may be a caching issue. Try setting
session_cache_limiter('nocache').

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

https://addons.mozilla.org/en-US/firefox/addon/3829

Regards,

John Peters

On Apr 13, 3:50 pm, Brennan Mann <brennan.m...@gmail.comwrote:
Hello, I am having problems updating PHP session variables. I can set
them and see them using the following debug print_r($_SESSION); Once,
I start using smarty templates, I cannot modify the PHP session
variables. Does smarty tags overwrite or disable PHP session vars?

session_name("ShoppingCartUserSession");
session_start();
session_register("iwsUsername");
session_register("iwsFirstName");
session_register("iwsAdminLogin");
$_SESSION["iwsUsername"] = "Brennan";

Once I hit the smarty template

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

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

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
Jun 2 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Brian | last post by:
Hello, I am trying to work out how to have smarty use a string's contents as the display-> template.. ie: $smarty->display($buffer); obviously $buffer isn't a filename, but a smarty template...
2
by: Daan | last post by:
Hello all, I'm having a little problem with Smarty. Getting it to work in a simple case went fine, but now I have the following situation: / /smarty /templates template.tpl /templates_c
1
by: Richard | last post by:
I need help. I have a smarty based program that I am modifying. I have a smarty template file that consists of smarty and HTML. I need to integrate some PHP database calls into it. My problem...
2
by: M | last post by:
Hi Folks, I am trying to install Smarty using PHP 5 on a Windows XP PC using IIS v6 The following PHP File: <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head>
0
by: Matt | last post by:
geez, i've done this a million times, you'd think i could get it right. uploading to production server for a new site, and part of the head.inc that starts everything up looks like this: echo...
0
by: Conrad | last post by:
Hi, I'm very new to Smarty Template Engine and I'm using PHP 5.0.4 on the Windows XP Professional platform and I have the following question: When I change the 7th line of the script to use a...
1
by: jimmyB | last post by:
Hi, I have one query and I hope you people can solve it. Problem is related to Smarty Caching Database Templates.. Most popular web applications and forums like IPB (invision power board) and...
6
by: K. | last post by:
Hello! I have a problem with using php on smarty web page I would like to use a php code from this web page: http://www.money.pl/webmaster/# i.e.. <?php readfile...
18
by: John | last post by:
Something strange has just started to happen as I have been developing a db application on a site. Suddenly a session variable has stopped working as I pass it from 1 page to another (I am sure it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.