How to Print/Echo the Moodle Sesskey (Session Key)

Wednesday, August 03, 2011 Sukhwant Lota 2 Comments

Whilst developing some custom pages I wanted to create a custom link to login as a particular user.  In order to login as a user you need a couple of variables, the users moodle id, and the your session key.

To print/echo the session key within Moodle you need the following line of code :-

echo $USER->sesskey;



2 comments: