CodeIgniter Forums
How to redirect with context - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: How to redirect with context (/showthread.php?tid=76476)



How to redirect with context - trentada - 05-15-2020

Hi Guys,

I have a requirement to go directly to a 'post' in my website members section from a link in an email. At the moment, if the user is logged on, all is good, but if they're not they are re-directed to the home page and the context in the URL is lost.

I have changed the code to redirect to the logon page but the context is still lost. Is there a way to pass data with the redirect or should I be calling the view and pass the data in there? Also, I don't think I can use cookies as there is also links coming from SMS messages.

Any help would be much appreciated.

Kind Regards
Trent


RE: How to redirect with context - InsiteFX - 05-15-2020

How about saving it in a session variable, or a flash data.


RE: How to redirect with context - trentada - 05-17-2020

Yep, that was it! Thanks for the advice, worked treat :-D