how to redirect session login url in moodle

Mo. picture Mo. · Oct 6, 2014 · Viewed 8.8k times · Source

Moodle normally redirect to login page when session Timeout.

Is there any option to redirect another page url instead of going to

$CFG->wwwroot.'/login/index.php'

Answer

Arvind dhakar picture Arvind dhakar · Feb 16, 2017

Yes by using redirect() function, you can redirect from one page to another page in moodle.

Example

$urltogo= $CFG->wwwroot.'/dashboard/';
redirect($urltogo);