Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
238 views
in Technique[技术] by (71.8m points)

php - How, Why and where is the table ci_sessions used in Codeigniter sessions?

I am really having a hard time to understand the use of the table ci_sessions. So I'm learning sessions and how to work with them in codeigniter and was introduced to this concept of creating a table in the below format,

CREATE TABLE `ci_sessions` (
  `id` varchar(128) NOT NULL,
  `ip_address` varchar(45) NOT NULL,
  `timestamp` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `data` blob NOT NULL
)

I have configured my CI application to work with the session library and I have even tried a simplate example like $this->session->name = "Alex"; in which I observed that a new entry was created in the table. Everything is understandable up to this point but I cant understand potential places/places where I would use this table and what purpose it serves.

As an example Say I am supposed to use a session to "remember" a user who has logged in and for that I can use something like the below,

$this->session->isLoggedIn = True; and pass this through places where I want to skip the authentication. What is the use of this table and out of the data in it what can I do from it.

Would really appreciate of someone can clear this for me.

I did try my best and came across this question but it was not marked as answered : How to use session table in code igniter

question from:https://stackoverflow.com/questions/65842133/how-why-and-where-is-the-table-ci-sessions-used-in-codeigniter-sessions

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...