Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
ලංකාවේ හොඳම උපකාරක පන්ති සහ ගුරුවරුන් එකම තැනකින් - TopTuition.lk
dulithapathum
Updated:
Today at 8:07 AM
Colombo
RidhMathraa ’26 🎶✨
Tmadhusanka
Updated:
Wednesday at 11:58 PM
Ad icon
Colombo
PXN V10 Pro Direct Drive Racing Wheel (Under Warranty)
Abdur Rahman
Updated:
Wednesday at 10:23 PM
Ad icon
USDT ණය සේවාව - USDT Loan Service
පුරවැසියා
Updated:
Wednesday at 4:54 PM
Ad icon
🎮 INDIAN PSN GIFT CARDS AVAILABLE NOW! 🎮
madukaperera
Updated:
Tuesday at 12:57 PM
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
PHP and MySQL help
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="3rdEye" data-source="post: 20667064" data-attributes="member: 501105"><p>[CODE]</p><p><?php </p><p>if (!defined('BASEPATH')) exit('No direct script access allowed.');</p><p> /**</p><p> * Remember me Helper</p><p> */</p><p>class Remember_me {</p><p> function __construct() {</p><p> $this->loged_user_through_cookies ();</p><p> }</p><p> function loged_user_through_cookies() {</p><p> $CI = & get_instance ();</p><p> if (! $CI->session->userdata ( 'logged_in' )) {</p><p> $CI->load->model ( 'login_model', '', TRUE );</p><p> $CI->load->helper ( 'cookie' );</p><p> $cookie = get_cookie ( $CI->config->item ( 'remember_cookie_name' ), TRUE );</p><p> $cookie_data = unserialize ( $cookie );</p><p> </p><p> if (isset ( $cookie_data ['key'] ) and isset ( $cookie_data ['user_id'] )) {</p><p> $usercookie_data = $CI->login_model->get_user_cookie_data ( $cookie_data ['user_id'], $cookie_data ['key'] );</p><p> </p><p> if (count ( $usercookie_data )) {</p><p> $CI->session->set_userdata ( array ('logged_in' => true,'user_id' => $usercookie_data [0]->user_id,);</p><p> </p><p> // Renew users cookie to prevent it from expiring</p><p> set_cookie ( array ('name' => $CI->config->item ( 'remember_cookie_name' ),</p><p> 'value' => $cookie,</p><p> 'expire' => $CI->config->item ( 'remember_me_cookie_life' ) ) );</p><p> $CI->login_model->update_userdata_on_login ( $usercookie_data [0]->user_id );</p><p> }</p><p> }</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>මේක පොඩ්ඩක් බලපන්..උබේ explain එකෙන් එන්නේ නැහැ හරි idea එකක්...</p><p></p><p></p><p>ඕකෙදි කරලා තියෙන්නේ Remember_me library එකක් ලියලා auto load කරලා තියෙන්නේ..පලවෙනි request එකේදිම update වේවි </p><p></p><p>තව දෙයක්,අනිත් දවසේ CI session table එක edit නොකර කරන දෙයක් කරන්න. Very bad programming <img src="/styles/default/xenforo/smilies/default/wink.gif" class="smilie" loading="lazy" alt=";)" title="Wink ;)" data-shortname=";)" /></p></blockquote><p></p>
[QUOTE="3rdEye, post: 20667064, member: 501105"] [CODE] <?php if (!defined('BASEPATH')) exit('No direct script access allowed.'); /** * Remember me Helper */ class Remember_me { function __construct() { $this->loged_user_through_cookies (); } function loged_user_through_cookies() { $CI = & get_instance (); if (! $CI->session->userdata ( 'logged_in' )) { $CI->load->model ( 'login_model', '', TRUE ); $CI->load->helper ( 'cookie' ); $cookie = get_cookie ( $CI->config->item ( 'remember_cookie_name' ), TRUE ); $cookie_data = unserialize ( $cookie ); if (isset ( $cookie_data ['key'] ) and isset ( $cookie_data ['user_id'] )) { $usercookie_data = $CI->login_model->get_user_cookie_data ( $cookie_data ['user_id'], $cookie_data ['key'] ); if (count ( $usercookie_data )) { $CI->session->set_userdata ( array ('logged_in' => true,'user_id' => $usercookie_data [0]->user_id,); // Renew users cookie to prevent it from expiring set_cookie ( array ('name' => $CI->config->item ( 'remember_cookie_name' ), 'value' => $cookie, 'expire' => $CI->config->item ( 'remember_me_cookie_life' ) ) ); $CI->login_model->update_userdata_on_login ( $usercookie_data [0]->user_id ); } } } } [/CODE] මේක පොඩ්ඩක් බලපන්..උබේ explain එකෙන් එන්නේ නැහැ හරි idea එකක්... ඕකෙදි කරලා තියෙන්නේ Remember_me library එකක් ලියලා auto load කරලා තියෙන්නේ..පලවෙනි request එකේදිම update වේවි තව දෙයක්,අනිත් දවසේ CI session table එක edit නොකර කරන දෙයක් කරන්න. Very bad programming ;) [/QUOTE]
Insert quotes…
Verification
Winadiyakata thappara keeyak tibeda?
Post reply
Top
Bottom