Welcome Guest, Not a member yet? Register   Sign In
aren't cookies global?
#9

(11-10-2017, 01:51 AM)richb201 Wrote: Thx for the response, but I think you are misunderstanding the real question here. I have tried both sessions and cookies but they both seems to fail the same way. I'll give an example with $_SESSION.

users.php

session_start();
$_SESSION['user']="me";
redirect('configure');

This works fine and I can see "me" in the $_SESSION array before I run the redirect line. Now I continue excution. Now I run another function which is in a different controller module (configure.php). It seems that the redirect blanked out the session variable.  _ci_last_regenerate= xxxxx123


configure.php

echo $_SESSION['user']

It seems that in the second module the $_SESSION array is blank except for the _ci_last_regenerate=xxxxx129

So the real problem is that I can get the userid from code in user.php, but then I can't communicate that userid to my functions in configure.php.  Bottom line: I need to share that userid with both modules.

In the code above you are calling session_start() which, if you are using the CI session library, you should not do. Loading the session library makes the call to session_start() for you.

Otherwise, your problem has the feel of incorrect session and/or cookie $config settings.
Reply


Messages In This Thread
aren't cookies global? - by richb201 - 11-09-2017, 02:24 PM
RE: aren't cookies global? - by neuron - 11-09-2017, 11:40 PM
RE: aren't cookies global? - by richb201 - 11-10-2017, 01:51 AM
RE: aren't cookies global? - by dave friend - 11-13-2017, 09:47 AM
RE: aren't cookies global? - by InsiteFX - 11-10-2017, 05:12 AM
RE: aren't cookies global? - by richb201 - 11-11-2017, 11:28 AM
RE: aren't cookies global? - by PaulD - 11-11-2017, 12:29 PM
RE: aren't cookies global? - by richb201 - 11-11-2017, 12:43 PM
RE: aren't cookies global? - by PaulD - 11-11-2017, 12:55 PM
RE: aren't cookies global? - by richb201 - 11-13-2017, 10:56 AM
RE: aren't cookies global? - by dave friend - 11-13-2017, 02:42 PM
RE: aren't cookies global? - by richb201 - 11-13-2017, 03:15 PM
RE: aren't cookies global? - by dave friend - 11-13-2017, 06:29 PM
RE: aren't cookies global? - by richb201 - 11-14-2017, 03:53 PM
RE: aren't cookies global? - by InsiteFX - 11-15-2017, 03:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB