I want to build a splash page for a CakePHP site which will show up if a user has not visited the site before (no session data?) but remember where they were going (get the URL) then when they carry on to the page they are set to the place they were going.
The site is a Japanese help site and has an embedded font which is about 5mb~ so I want to give the user the option to Download a local copy or (maybe) turn it off for that session.
Any suggestions for an optimal way to do this with CakePHP?
Create a copy of
lib/Cake/Controller/AppController.phpand put it on/app/Controller/AppController.phpif you don’t have one in there already. Override its parent’sbeforeFilter()method to something like this:Now on your
PagesController::splash(), you should render your splash page, control the actions the visitor does, and then send them to whatever there is on$this->Session->read('redirect_url');. Remember to delete this data from the session with$this->Session->delete('redirect_url')before the redirection.Hope that helps.