Welcome Guest, Not a member yet? Register   Sign In
session not working?
#1

(This post was last modified: 02-18-2020, 11:13 AM by jreklund.)

Login.php
-------------

i stored the value
PHP Code:
$_SESSION['logvalue']="89"

Redirect.php
---------------
PHP Code:
echo " -  - "$_SESSION['logvalue']; 


This is working on local Apache server. but not working on PLESK and 000Webhost..?
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: logvalue


Thanks..
Reply
#2

Why you just not using :

Code:
$this->session->set_userdata()
 
Or for CI4

Code:
$session->set()

Before it you must call the session library.
Reply
#3

(02-18-2020, 07:59 PM)mjamilasfihani Wrote: Why you just not using :

Code:
$this->session->set_userdata()
 
Or for CI4

Code:
$session->set()

Before it you must call the session library.


Both ways work the same as i understand it, only difference between them being the CI session library has helper functions that makes things easier to do/work with.
 
In my case, I personally prefer pushing/deleting all my values to/from the $_SESSION variable (the way I learned way back in '03) and use the CI helper functions as needed.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB