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

I'm using now native session library and it seems all to be ok, and problems are solved. I think developers should include this library instead of a that one CI using now. It makes CI not stable...

[eluser]Derek Allard[/eluser]
Blazer, wakextreme, or anyone else reporting this. Can you provide any further information? I have a few questions

1) What is your sess_expiration set to?
2) Is your server's clock correct? Is your machine?
3) Is this reproducible in IE 6 or 8?
4) Anything to add? Any extra information that will track this? You've said it doesn't work, but I'm looking for more information to help me track this down. I've never been able to see it personally.

Derek, there is info:
1) 7200
2) It's correct, server is my machine where I'm developing
3) It happens in opera, firefox and IE, so I think browser is not a reason
4) After every session lost, there is record in logs:
ERROR - 2008-05-28 16:02:51 --> Severity: Notice --> unserialize() function.unserialize: Error at offset 1062 of 1588 bytes Z:\home\partner.mobistic.l\system\libraries\Session.php 215

It seems that sessions lib can't operate with a some kind of data or some symbols in it, which caused unserialize to fail..

If you have any other questions - please ask, I think we should solve this problem to make CI best ever framework Smile

[eluser]Henrik Pejer[/eluser]
Do you store your sessions in the database or in a cookie?
You are aware that if you use cookies and no database, there is a limit as to how much data you can store?

It doesn't matter database or cookie - the same problem happens, I tried to switch it in config. I counted size of serialized vars and that is 1318 bytes - is it very much?..

[eluser]Henrik Pejer[/eluser]
I do not know the exact limit, though I guess one should store only a limit amount of data in there.

The unserialization error suggests that the string it is trying to unserialize either is not a complete object, or there is an encodeing issue that messes things up.

Ofcourse there could be other issues aswell.

Can you serialize/unserialize the exact same data?

[eluser]Derek Allard[/eluser]
can you share the code you are using to generate the cookie in question? I'd like to see if I can reproduce. Which version of PHP?

class Projects extends Controller {
var $project, $service;

function __construct() {
   $this->project = $this->session->userdata('project');
   $this->service = $this->session->userdata('service');

function select() {
   $this->session->set_userdata('service', $this->service);
   $this->session->set_userdata('project', $this->project);

function index() {


Code returns "false false";

var_dump of $this->service before set it to session in select() function:

object(stdClass)#29 (6) {
string(1) "7"
string(18) "Сообщения"
string(0) ""
string(8) "messages"
string(1) "0"
string(1) "N"

..and var_dump of $this->project:
object(stdClass)#28 (14) {
string(3) "102"
string(37) "Сообщения Авторадио"
string(0) ""
string(4) "none"
string(3) "914"
string(1) "0"
string(3) "103"
string(1) "7"
string(0) ""
string(0) ""
string(19) "0000-00-00 00:00:00"
string(1) "Y"
string(0) ""
string(0) ""

If variable's data is change (with the same structure) - session is still lost, this data is only shows example.
When I try to serialize and then unserialize this data, there's no errors, such as in system logs.
PHP version is 5.2.4

I've come across one reproducible way of losing session data in Internet Explorer 6. A site that I recently worked on has links to MS Word .doc files, opening one of those files in the browser instead of choosing to save it locally resets the session information. I have the sessions stored in a DB, when I checked it I see two records for anyone that opens a document after logging into the site. one with a user agent "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;" and the other is "Microsoft Data Access Internet Publishing Provider".

I've read here that something similar happens when using SWFUpload.

Not sure where to go from here, any ideas?

[eluser]Derek Allard[/eluser]
OK, I have a followup. I was finally able to recreate on a domain using IE. The problem was simply that I forgot to set
after I added ".domain.com" to the config, it worked great. It seems this only mattered to IE. If anyone else had issues, I'd be grateful for corroboration on this issue.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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