Forum Moderators: coopster

Message Too Old, No Replies

PHP Session Problems

PHP Session Problems with Zencart and CakePHP

         

axpen

10:49 pm on Aug 31, 2007 (gmt 0)

10+ Year Member



Ok I have a problem with Zencart and CakePHP, I don't necessarily know that it's a problem with Zencart or CakePHP, I'm not an expert on PHP sessions. My problem is as follows, I need a way of accessing Zencart's admin_id $_SESSION variable so I can see if the user is logged into zencart from CakePHP. Problem is i've mimicked zencarts session info down to setting the cookie path (all from within PHP). So my question is, how is Zencart denying outside PHP scripts access to it's SESSION variable?, and how do I access it anyway?

--Thank you all for your help
Alex

phparion

4:48 am on Sep 1, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi Alex,

I would suggest you to try ZenCart forum there you will find a pool of people working with zencart and the chances to get rapid and meaningful help will be increased.

BTW I would start by reading the zencart function reference or documentation to understand its session handling.

axpen

12:36 am on Sep 4, 2007 (gmt 0)

10+ Year Member



Well the problem i'm having isn't with Zencart in particular, it's rather with how sessions are handled in general. Like first of all how do you maintain 2 different sessions, by name and ID? What is the relation of session name vs. ID, I know that the name is like the key while the ID is like the value (i.e. name=id). How for example would one change their session to another, I.E. how would I switch from a session (say CakePHP) to another session (say zenCart). Wouldn't I first change my session id and name, then the cookie tmp path (so I will have access to the actual files)? If that doesn't let me read session B's variables, what else could be going wrong? I really don't think this is Zencart specific, I believe that this lies in my misunderstanding of the way sessions work in general. I appreciate your redirection to the zencart forum and if I indeed find this to be a zencart specific problem I shall take that advice, i'm just hoping someone here will be able to shed a more general light on the subject.

--Thanks, Alex

Habtom

5:09 am on Sep 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your sessions do look like the following:
$_SESSION['CakePHP']
$_SESSION['zenCart']

Those can contain different values. Sessions are more of like variables, but remain stored helping you reuse the values in them page after page on the same system.

dreamcatcher

6:42 am on Sep 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To see whats in your current session array use the following:

echo '<pre>';
print_r($_SESSION);
echo '</pre>';

dc