Need security token to logout admin automatically - Joomla! Forum - community, help and support


i can't seem find how handle security token that's required logout admin user. i've created custom component authentication , after amount of time of sitting on custom page, need log out user (window.location in js).

i tried this:
window.location = "index.php?option=com_login&task=logout";

i know url doesn't have last security token on (like joomla logout button in top right of console).

but produces error message:
the recent request denied because contained invalid security token. please refresh page , try again.

i found post adding '&return=lw' should used didn't work either.

any ideas?

thanks!

i love answering own questions... grep'd joomla source code , found worked me.

jsession::getformtoken() .'=1'

so full line in javascript:

window.location = "index.php?option=com_login&task=logout&<?php echo jsession::getformtoken() .'=1' ?>";





Comments