Hello,
before my javascript is delivered to the server, there are some php code in the file
<?php
$ts = time();
$token = generate_action_token($ts);
$url = elgg_get_site_url() . 'action/agvideo/rate?__elgg_ts='.$ts.'&__elgg_token='.$token;
?>
And a if else
<?php if(!elgg_is_logged_in()){ ?>
//do this javascript
<?php }else{ ?>
//do something else
<?php } ?>
Everything works fine, but when I turn on simle cache it won't, because only
one possibility is cached and so the time and token is wrong.
Is there a possibility to get this vars with javascript
- the token and the time
- if the user is logged in
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- iionly@iionly
iionly - 0 likes
You must log in to post replies.There are some Javascript equivalents available of the functions you seem to require: http://docs.elgg.org/wiki/Javascript/BuiltInFeatures.