Welcome Guest, Not a member yet? Register   Sign In
How to create custom session using codeigniter
#1

[eluser]senz[/eluser]
Hi all,
I want to make a session with codeigniter. But i want to add the field such as session_host and session_page from the existing session table, which aims to know the hostname of the visitor and any pages that have been visited by visitors. My question is, how to create custom session using codeigniter? Do I need to change the session files in a library? Or is there any configuration should I add?
FYI :
i have made table ci_sessions
-----------------
Field Name
-----------------
sessions_id
ip_address
user_host => hostname from the visitors
session_page => the page has been clicked by visitors
user_agent
last_activity
-----------------
Please help me!!

Regards,
Senz
#2

[eluser]Thorpe Obazee[/eluser]
Code:
$this->session->set_userdata('session_host', 'value');
$this->session->set_userdata('session_page', 'value');

You don't need to change anything in the config or the Session Library.
#3

[eluser]senz[/eluser]
Where that codes should I put?
#4

[eluser]Bart v B[/eluser]
[quote author="senz" date="1272550846"]Where that codes should I put?[/quote]

In youre Controller or model, where you need to change the session Wink
#5

[eluser]billmce[/eluser]
Check out the user guide: http://ellislab.com/codeigniter/user-gui...sions.html




Theme © iAndrew 2016 - Forum software by © MyBB