Welcome Guest, Not a member yet? Register   Sign In
Questions about CI sessions table
#1

[eluser]bogdan3l[/eluser]
Hello!

1.
------------------------------------------------------------------------------------------

Why session_id field is varchar(40)?

Each session_id has a length of 32 characters.

Should I change this field to char(32)?

2.
------------------------------------------------------------------------------------------

Why ip_address field is varchar(16)?

An ip_address like 192.155.135.125 has a length of 15 characters.

Should I change this field to varchar(15)?

------------------------------------------------------------------------------------------

I hope someone can answer me at this questions. Thank you!

These small changes will help me sleep better at night Smile.
#2

[eluser]InsiteFX[/eluser]
No do not change it! If you look at the session library code you will see that they are adding on the users IP Address for security reasons...

A good place to learn is open up and start reading the CodeIgniter Libraries.

InsiteFX
#3

[eluser]bogdan3l[/eluser]
Thank you for your answer!

When a new session is created the session_id field will have a length of 32 characters not 40.

(Look at the line 316 inside the session library on CI 2).




Theme © iAndrew 2016 - Forum software by © MyBB