Welcome Guest, Not a member yet? Register   Sign In
CI Session Class
#1

[eluser]newsmuncher[/eluser]
Hello i am trying to get the CI session class working. I have my session updating on every page load, which is ok. When i try and run Simplepie to retrieve a feed on my site, it crerates multiple instances of different session's in the database. Its almosts as if the cookie has been reset. It works fine if i just browse the site, but not sure what would happen if say Googlebot or another bot came onto my site.

This is my settings:

Code:
$config['sess_cookie_name']        = 'newsmuncher';
$config['sess_expiration']        = 7200;
$config['sess_encrypt_cookie']    = FALSE;
$config['sess_use_database']    = TRUE;
$config['sess_table_name']        = 'xxxx';
$config['sess_match_ip']        = FALSE;
$config['sess_match_useragent']    = TRUE;
$config['sess_time_to_update']     = 0;

Code:
$config['cookie_prefix']    = "";
$config['cookie_domain']    = "";
$config['cookie_path']        = "/";

The IP address used to access the site is the same as the server and i have even tried to match ip addresses, but this doesn't work.
#2

[eluser]WanWizard[/eluser]
Sessions are created based on the absence of the session cookie. So for every 'visitor' of your site that isn't able to present a valid session cookie, a new session is started. That includes bots, wgets, flash objects, etc...
#3

[eluser]newsmuncher[/eluser]
How do i tell which session is active and which is not?
#4

[eluser]WanWizard[/eluser]
You can't. What's the definition of "active"?

Sessions have a last update timestamp, given the update time configured you could try to figure out how 'stale' a session record is.
But what's the point? Sessions have an expiry (if you've set it to 'very long' you're doing something wrong), and expired sessions will be cleaned up automatically.
#5

[eluser]newsmuncher[/eluser]
Yeah, but it would be a useful tool to have as "users online". The feed grabber sends multiple requests to the server so it generates a new session id everytime and adds it to the database, so one page load creates about 30 rows in the database. What im trying to say is that the moment i reload the page i have redundant sessions in the database doing nothing, which would make it impossible to track the users.


The multiple instances of the same user, have the same ip, user-agent and time etc. The only thing that is different is the session ID!




Theme © iAndrew 2016 - Forum software by © MyBB