[eluser]theknight[/eluser]
[quote author="InsiteFX" date="1336685049"]See if this will work:
Code:
redirect(site_url(), 'refresh');
If it is crashing when the user trys to login twice, you should being
checking to see if user_id is already logged in.
Use CodeIgniters Form_validation class and set the rules on the user name to a callback
to see if the user name matches.
Check your session user_id and see if it matches your database record before trying to
log them in again.
[/quote]
Hi I am not storing session Ids within the database, rather I am creating them on the fly. As soon as the user logs in first time.
Code:
Here is where your problem is:
[code]
if(isset($_POST['username'])){ // logging in
// if they are already logged in you do not want to do this!
$login_res=$this->members->login();
[/quote]
Is there anyway thru php I can check if the session has already been created, I uses $_SESSION variable to check but it was empty.
Doing this too:
echo $this->session->userdata('user');
Cheers.