Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Session_id in links at cached pages

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
ChrisFah
Smarty Pro


Joined: 02 Nov 2009
Posts: 159
Location: Traun, Austria

PostPosted: Tue Apr 10, 2012 6:51 pm    Post subject: Session_id in links at cached pages Reply with quote

Hi guys,
I am looking for a way to handle links with session_ids at cached pages.
Example:
Code:
<a href="page2.php?session_id=123456789">page2</a>

In former projects I used a "dummy-session_id" like ?session=[SESSION] and replaced it with real session id (for user without cookie support) or deleted it if not necessary (with cookies turned on) with output_filter when using $smarty->display().

Is there a better way to support session in cached pages when user does not accept cookies ????

Lg, Chris
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Apr 10, 2012 8:02 pm    Post subject: Reply with quote

What's about

Code:
<a href="page2.php{$session nocache}">page2</a>


and

Code:
$smarty->assign('session','?session_id=123456789');

or

$smarty->assign('session','');
Back to top
View user's profile Send private message
ChrisFah
Smarty Pro


Joined: 02 Nov 2009
Posts: 159
Location: Traun, Austria

PostPosted: Tue Apr 10, 2012 10:36 pm    Post subject: Reply with quote

Besser!
Was aber, wenn der Link bereits im PHP Teil gebildet wird und als fertiger "string" an Smarty assignt wird?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Apr 10, 2012 11:01 pm    Post subject: Reply with quote

Kannst doch den gesamten link optional zusammen bauen, assignen und nocache im template ausgeben.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP