Hook_init là gì, tùy chỉnh biến lưu user ở đâu?

Mỗi lần em đăng nhập ở localhost hay ở groups.drupal cũng vậy, nếu ko đăng xuất ra thì ngày hôm sau vào lại nó vẫn lưu thông tin đăng nhập. Cho em hỏi có chổ nào tùy chỉnh chế độ này không? tại vì nếu để như vậy thì hơi kẹt về chuyện bảo mật.
Em hay nghe người ta nhắc đến hook_init, em hình dung nó giống như cái gì đó gần gủi và quen thuộc với mọi người lắm. Ngặc nổi em tìm hoài mà ko biết nó nằm ở đâu, chức năng nó làm gì..? hic.. xin các cao thủ chỉ giáo dùm em với!

Comments

hook_init, sessions table

1. hook_init, Drupal là hệ thống hướng mô-đun (modular system), cho phép bạn can thiệp vào rất nhiều chi tiết trong quá trình xử lý của nó. Trường hợp bạn định nghĩa module là `custom`, và có hàm custom_init, thì hàm này gọi là một thực thi của hook_init, với cấu trúc, custom -- tên module, init -- tên quá trình cần can thiệp. Hook này sẽ được gọi trong trước khi Drupal xử lý tạo nội dung cho request. Tham khảo thêm tại đây, tham khảo toàn bộ hook mà Drupal 6 hỗ trợ tại đây.

2. Thông tin của các session được lưu ở bảng {sessions}. Trường hợp của bạn, có thể tạo kịch bản để dọn dẹp session thường xuyên (chú ý cột timestamp, cache). Cũng chú ý đến biến `cache_lifetime`.

Thế Hồng

Cảm ơn anh TH rất nhiều!

Thì ra là vậy! Em hiểu sơ sơ rồi, hi. Cảm ơn anh TH nhiều!

h

minh la thanh vien moi

h

minh la thanh vien moi
minh muon tim hieu sau hon ve chung trinh nay co ban nao biet nhieu ve mot van de gi do hay noi them cho minh cha han nhu nghe doc hieu thi phai vao phan nao

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <sup> <br> <p> <h3>
  • Lines and paragraphs break automatically.
  • Link to content with [[some text]], where "some text" is the title of existing content or the title of a new piece of content to create. You can also link text to a different title by using [[link to this title|show this text]]. Link to outside URLs with [[http://www.example.com|some text]], or even [[http://www.example.com]].
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.