Welcome Guest, Not a member yet? Register   Sign In
SESSION & IP
#1

[eluser]bogdan3l[/eluser]
Hello!

I use the ci session library with my database, but, i don't like the ip to be varchar(16).

Could somebody help me to change the ci session library to store the ip as INT 11?

I tried with ip2long but i am afraid not to spoil something Smile!

I appreciate any help, thanks a lot.

Bye!
#2

[eluser]Sbioko[/eluser]
You can easily change this in PHPMyAdmin :-)
#3

[eluser]bogdan3l[/eluser]
I've done that but i want to change the ci session library too.

The default library store the ip exactly how it is (80.200.125.30) and i want the ip to be stored like (1355316510) => ip2long.

And i need some help to change the library and i don't want to mess things up Smile.
#4

[eluser]Sbioko[/eluser]
You can extend this library using MY_ prefix or prefix you specified in config.php file.
#5

[eluser]bogdan3l[/eluser]
Can you give me an example or something?

I appreciate. Thanks!
#6

[eluser]rogierb[/eluser]
Don't forget about ipv6...
#7

[eluser]Sbioko[/eluser]
You need to alter yout table.
Code:
ALTER TABLE `ci_sessions` MODIFY `ip` NOT_NULL INT(11);
Something like this.




Theme © iAndrew 2016 - Forum software by © MyBB