Redirects to a target site and includes the current session(s), if any.
Note that if you don't have any active sessions, you can still safely use this tag, it will work exactly like redirect_url.
Also note that if you do have sessions and you're redirecting to outside your website, be sure to either use redirect_url instead, or know that you'll be passing the session IDs too.
Click the "Download" button below to retrieve a copy of this tag,
including the complete documentation and sample usage shown
on this page. Place the downloaded ".inc" file in your
LassoStartup folder, restart Lasso, and you can begin using this
tag immediately.
[
define_tag:'lp_session_redirect',
-description='Redirects to a target site and includes the current session(s), if any.',
-priority='replace',
-required='url';
/*
Note that if you don't have any active sessions, you can still safely use this tag, it will work exactly like redirect_url.
Also note that if you do have sessions and you're redirecting to outside your website, be sure to either use redirect_url instead, or know that you'll be passing the session IDs too.
*/
local:'sessions' = (lp_session_id: -url)->(join:'&');
local:'target' = string;
local:'anchor' = string;
// does the URL already have parameters?
if: #url->(contains:'?');
local:'symbol' = '&';
else;
local:'symbol' = '?';
/if;
// does URL have an anchor?
if: #url->(contains:'#');
local:'split' = #url->(split:'#');
#anchor = '#' (#split->(get:2));
#target = #split->(get:1);
else;
#target = #url;
/if;
// --debug--
// return: (#target #symbol #sessions #anchor);
// redirect to the URL
redirect_url: (#target #symbol #sessions #anchor);
/define_tag;
]