Welcome Guest, Not a member yet? Register   Sign In
2 different sessions at the same time
#1

[eluser]rijobo[/eluser]
Hello,

I'm using a session for my shopping cart and a session for my log in system for the customers.
When I try to use the session variables of my shopping cart I get this message:

Message: Undefined variable: _SESSION

is it possible to use 2 sessions at the same time?
#2

[eluser]Colin Williams[/eluser]
It's the same session, just different data. For instance, an user with a cart but not logged in simply wouldn't have a valid logged in flag in the session, but they would have a cart id.

Also, if you're using the Session class provided by CI, there is no reason to access $_SESSION. If you aren't using CI's Session class, be sure you've started the session first
#3

[eluser]rijobo[/eluser]
But then why does it say undefined variable?
Before I implemented my login system, I didn't get this error.
#4

[eluser]Colin Williams[/eluser]
You want me to comment on code I can't see?
#5

[eluser]rijobo[/eluser]
You're right, I'm sorry.

I've already found what I did wrong. I forgot my session_start().




Theme © iAndrew 2016 - Forum software by © MyBB