Welcome Guest, Not a member yet? Register   Sign In
Geting Wrong Session Data using DB Session
#1

[eluser]Mizanur Islam Laskar[/eluser]
Hello,

I'm facing a trouble while using DB Session from the wiki http://codeigniter.com/wiki/DB_Session/. The thing is, my login page is on the home page and when I submit correct ID and Password, it authenticates and show me the correct username as my session value for the first time it redirects to the home page, but after that when I refresh myself that page or go to any other page, I get my session value as "assets"...well, regardless to say that my JS and CSS scripts are placed under mysite/assets/; but I think thats not the issue. Moreover, when I check in my phpMyAdmin, then it also shows that the value against the session variable is stored as "assets"...I think there is a simple fixing there in my code(given below)...so guys, need your expertisements here to help me:

My Partial CONTROLLER:
Code:
class Clients extends Controller
        {
        
          function Clients()
              {
             parent::Controller();
             $this->load->library(array('db_session'));
             }
            
          function index()
              {
            
              }            
         function welcome_client()
            {
             $this->db_session->set_userdata('client', $this->input->post('account_id'));
             $this->load->view('index',$data);
             }    
            
         }

My Partial VIEW:
Code:
<form action="welcome_client" method="post" id="login_form">
Client ID:<input id="account_id" name="account_id" type="text" size="10" /><br />
Password:<input id="account_password" name="account_password" type="password" size="10" /><br/>
              <div class="buttondiv" style="background-color:#D5D5D5; text-align:left;"><br/>
&lt;input name="Submit" type="submit" id="submit" class="submit_button" value="Login" style="height:23px;"  /&gt;
&lt;/form&gt;

My Partial config.php
Code:
$config['sess_cookie_name']     = 'http://localhost/project/mysite';
$config['sess_expiration']         = 7200;
$config['sess_encrypt_cookie']    = FALSE;
$config['sess_use_database']     = TRUE;
$config['sess_table_name']         = 'ci_sessions';
$config['sess_match_ip']         = TRUE;
$config['sess_match_useragent'] = FALSE;
$config['sess_time_to_update']     = 300;

My Partial autoload.php
Code:
$autoload['libraries'] = array('database', 'db_session');

Plz note that I didn't show my model and its relevant controller's function to check my ID and Password against the database, since that part is working fine. So I simplified this post so that I want to store my session from whaever I typed as my ID on the view form.


Messages In This Thread
Geting Wrong Session Data using DB Session - by El Forum - 07-14-2008, 08:12 PM
Geting Wrong Session Data using DB Session - by El Forum - 07-14-2008, 11:38 PM
Geting Wrong Session Data using DB Session - by El Forum - 07-14-2008, 11:43 PM
Geting Wrong Session Data using DB Session - by El Forum - 07-22-2008, 03:47 AM
Geting Wrong Session Data using DB Session - by El Forum - 07-22-2008, 06:09 AM
Geting Wrong Session Data using DB Session - by El Forum - 07-23-2008, 04:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB