codeigniter


Cookies not beeing set, codeigniter


I'm trying out cookies for first time in CI. Cant get it to work. Here's my code:
class Site extends CI_Controller {
public function index(){
$this->load->view('input_view');
$this->load->helper('cookie');
$this->test();
}
public function test(){
$cookie = array(
'name' => 'Test',
'value' => 'The Value',
'expire' => '86500',
//'domain' => '.some-domain.com',
'path' => '/',
'prefix' => 'myprefix_',
'secure' => TRUE
);
$this->input->set_cookie($cookie);
var_dump(get_cookie('Test'));
}
var_dump... returns false. I understand it does this the first time but should'nt it be true after reloading the page? I can't see any "Test" cookie in my web tools in Chrome either. Do I need the "domain" row? I googled some and if I understood it was optional? If it isn't, what am i suppose to write there? Localhost? In my config file i have this settings for cookies
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['cookie_secure'] = FALSE;
I'm guessing you're not running https for development.
The secure flag on your cookie forces the cookie to be sent over HTTPS only;
Secure:
If this cookie can ONLY be sent over HTTPS (SSL), set this value to true.
Set it to false, and the cookie should work.

Related Links

How to pass data to view and Load view into a variable
codeigniter Different/separate 404 page for frontend and backend
php code to select and echo image from database in codeignitter
what is question mark means in the url in php codeigniter framework
CodeIgniter - Load language globally (not by file but by folder)
How to Integrate Recurring payment using Barclaycard in Codeigniter?
Server error 500 in codeigniter
How to Verify Email to see if it is exist in Code Igniter?
when I use If isset($_FILES['something'] I can't access my controller array in my view in codeigniter?
Unable to load the requested class Session in Codeigniter
resetting password in codeigniter
having trouble in join query in codeigniter
How to host a website with CodeIgniter on a server?
codeigniter Trying to get property of non-object
Codeigniter - Call to undefined function set_value()
Is it dbase is support on Codeigniter 3?

Categories

HOME
typescript
validation
hadoop
pyqt5
x-editable
load
rtmp
isis
typeahead.js
chronicle
xamarin.forms-listview
redhat
delphi-xe7
range
wso2-das
openframeworks
openui5
yii2-advanced-app
git-svn
embed
api-design
durandal-2.0
gas
teamcity-9.0
jscodeshift
windows-applications
django-autocomplete-light
azure-ad-graph-api
liferay-aui
intersystems
mathdotnet
typemock-isolator
ucwa
toastr
dlopen
groove
subtotal
edit-distance
microsoft-translator
linechart
dsx
csr
easy-digital-downloads
automata-theory
angular2-seed
stateful
tern
virtualmin
uifont
azure-cdn
mrtg
xbrl
htc
dwr
gpt
topojson
hapi.js
sound-synthesis
hyperterm
menustrip
target-platform
groupbox
hl7-v2
flexigrid
mysqladmin
thinktecture-ident-server
post-processor
nominatim
many-to-one
ehcache-bigmemory
easynetq
llvm-gcc
mks
reactive-cocoa-3
nolio
mklink
bitrock
laravel-validation
gdk
monk
nawk
mips64
visual-assist
guice-servlet
sizzle
tempo
sender
google-profiles-api
undeclared-identifier
intel-8080
stumbleupon
soapheader
mkreversegeocoder
system-tray
android-searchmanager
unitils
adbwireless
gedcom
clipboard-pictures
plumtree

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App