Hey everyone.
I created custom sessions for my website, It basically checks when session was created and what the last impression was on the site for that session.
it has been logging me out and i was checking out why so i did a query:
SELECT id, ((NOW() - created)) AS CREATED,((NOW() - last_impression)) AS LAST from user_session
as I was monitoring it lets say CREATED AND LAST was 18 seconds and i would wait maybe 2-3seconds and execute the query all sudden I get like 56 seconds so all sudden its jumping by so many seconds and I figured this is why im gettin loggeed out.
It does not happen all time. well most time im saying it can happen maybe at 1023 seconds and it will keep jumping with in intervals.
This is what my query looks like:
SELECT * FROM user_session WHERE ascii_session_id = '2d1e48ad81ac2165699c8eccf0b67e01' AND ((NOW() - created)
< '86400 SECONDS') AND user_agent = 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.8) Gecko/2009032608 Firefox/3.0.8' AND ((NOW() - last_impression)
< '3600 SECONDS' OR last_impression IS NULL)
Just to show you an ex.
id int(11) NOT NULL auto_increment,
ascii_session_id varchar(64) default NULL,
logged_in tinyint(1) default NULL,
user_id int(11) default NULL,
last_impression timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
created timestamp NOT NULL default '0000-00-00 00:00:00',
user_agent varchar(256) default NULL,
info text,
PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=12505 DEFAULT CHARSET=utf8
structure of thetable.
Anyone have a clue why seconds jumps like crazy?