• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
$session set-bug?

#1
PHP Code:
$session->set($newdata); 
when I use this function, the session data only is available for the next request, then the data was automatically cleared , it is same as $session->setFlashdata('item', 'value'); 
it that a bug? 

How can I save the session data into cookie? then encrypt cookie data.
Q&A for Codeigniter
StartBBS--open-source, light weight forum software.
Best VPS:Digital Ocean
Reply

#2
It's working for me. Are you forgot to add this line?

PHP Code:
$session->start(); 
Reply

#3
(11-15-2016, 09:40 PM)ridho Wrote: It's working for me. Are you forgot to add this line?

PHP Code:
$session->start(); 
Thanks, I forget!!! it works well now. 
I am using the file to save session data, Can I save it to cookie via encrypt?

Now, the session was saved as file in my hosting. how long will the session be cleaned? 
frankly I don't like to save the data in webhosing. because the reading speed is slow than from cookie.
Q&A for Codeigniter
StartBBS--open-source, light weight forum software.
Best VPS:Digital Ocean
Reply

#4
Yes you can, but for what? I think, this is a bad idea for storing session data to cookie although it's encrypted.

Soon, if you use $session->destroy();

If you don't like files for storing sessions, You can use database for storing sessions.
Reply

#5
(11-15-2016, 10:06 PM)ridho Wrote: Yes you can, but for what? I think, this is a bad idea for storing session data to cookie although it's encrypted.

Soon, if you use $session->destroy();

If you don't like files for storing sessions, You can use database for storing sessions.
Thanks, it works well now.
Q&A for Codeigniter
StartBBS--open-source, light weight forum software.
Best VPS:Digital Ocean
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.