I'm just trying to make it a little more secure work for a user to use a stolen cookie.
I've read a post Is it possible for $_SERVER['HTTP_USER_AGENT'] to not be set? that say $_SERVER['HTTP_USER_AGENT']
might not be sent by user, the scenario is what type of user will try not to send $_SERVER['HTTP_USER_AGENT']
, and is it the main user group of my site.
Below is my current remember_me table looks like and I'm working on the device column now.
CREATE TABLE IF NOT EXISTS `remember_me` (
`rm_ID` varchar(4000) NOT NULL ,
`rm_device` varchar(165) NOT NULL ,
`rm_IP_created` varchar(39) NOT NULL ,
`rm_last_action` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`rm_cookie_created` TIMESTAMP,
PRIMARY KEY (`remember_me`)
)
If $_SERVER['HTTP_USER_AGENT']
is not suitable, what is the majority way for doing a device detection?
What I'm trying to do here is the prevent a cookie to be used in another device with different property such as cookie stored in Mac been used in window, or the version of web browser changed.
edited:
how about storing something like Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)
which could be null, however does this change often? I'm not quite sure about http://php.net/manual/en/reserved.variables.server.php 's function