• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Losing session data

[eluser]David BoreaNaz[/eluser]
still no go there...
i reset the values (from Session.php controller) to:
var $sess_encrypt_cookie        = FALSE;
    var $sess_use_database        = FALSE;
    var $sess_table_name        = '';
    var $sess_expiration        = 3600;
    var $sess_match_ip        = FALSE;
    var $sess_match_useragent    = TRUE;
    var $sess_cookie_name        = 'ci_session';
    var $cookie_prefix        = '';
    var $cookie_path            = '';
    var $cookie_domain        = '';
    var $sess_time_to_update        = 600;

leaving sess_expiration to match and sess_time_to_update, so that they match what's on config.php configuration. still same result...

InsiteFX, were you using Oracle database in your application? I am just curious, because if I use MySQL database, I do not get this error...

[quote author="David BoreaNaz" date="1269320857"][quote author="billmce" date="1269302443"]Interest, I solved my problem by changing from cookies to the database method of storing session info.
I made no other changes ... everything works.

Hours down the drain on that issue.

Seems that if you're using cookies, the session data is lost when the original function is reload.[/quote]

hi! may i butt in?
i also experience losing session data...
what is the database you are using?
i am trying to do this CI sessions + oracle database...
i hope someone can help me with this...[/quote]

I'm using mysql.
As I said ... using cookies I lost session data when the function was reloaded.
Using mysql everything works as expected.

Try changing the below:

$sess_time_to_update = 7200;


[eluser]David BoreaNaz[/eluser]
regarding my problem,
on clicking a link after i logged in into the system...
the session gets destroyed. as i understand it, i don't need to pass said session id (or anything) in order to check if one has succesfully logged in... is this right?

A very good auth library is Adam Griffiths Auth 1.0.6

Auth 1.0.6

I would download this and look at the code.


[eluser]KLODEnet di Stefano Surricchio[/eluser]
The right way to use the cookie, in order to maintain session data, is to set session and cookies related variables in the config.php file, like this:

$config['sess_cookie_name'] = 'name_of_session';
$config['sess_expiration'] = 0;
$config['sess_expire_on_close'] = FALSE;
$config['sess_encrypt_cookie'] = TRUE;
$config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'ci_session';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = FALSE;
$config['sess_time_to_update'] = 300;

$config['cookie_prefix'] = "nameofcookie_";
$config['cookie_domain'] = ".nameofdomain.com";
$config['cookie_path']  = "/";
$config['cookie_secure'] = FALSE;

This works like a charm for me.

Best regards.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.