CodeIgniter Forums
session help - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: session help (/thread-26253.html)



session help - El Forum - 01-09-2010

[eluser]dadamssg[/eluser]
how do i get this to redirect right? its a login. Im setting the session page variable for each page the user views and then when they login i want them to redirect to their current page. I know my session variable is holding a value i just cant seem to use it in the redirect

Code:
$page = $this->session->userdata('page');
redirect("mains/$page");



session help - El Forum - 01-09-2010

[eluser]jedd[/eluser]
Rather than ...
[quote author="dadamssg" date="1263093869"]
Code:
$page = $this->session->userdata('page');
redirect("mains/$page");
[/quote]

... try
Code:
$page = $this->session->userdata('page');
redirect("mains/". $page);