A
A
Alexander2016-07-13 12:49:47
Hashing
Alexander, 2016-07-13 12:49:47

Should the user's ip in the session table be stored in a hash?

There is a table of sessions in the database, where the session token and the IP to which it is attached are respectively stored. Is it worth storing the IP in a hash or can you get by with storing an integer value.

PS Is the conversion of IP to an integer value through INET_ATON() /INET_NTOA() or better through the php ip2long()/long2ip() function considered as a movie tone. Are sql queries cached when using INET_ATON()/INET_NTOA() ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander N++, 2016-07-13
@websiteserf

ip must be stored as a number if you have selections by range
, field type int + prohibit negative numbers in the column.
It is recommended to save via INET_ATON but it is also possible via ip2long

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question