How to Maintain two sessions in single site.... |
[eluser]MASS MASS[/eluser]
Can anybody help to handle two session data sequencly........
[eluser]xwero[/eluser]
What do you mean by handling two sessions? A user that has two parallel sessions?
[eluser]esra[/eluser]
Are you trying to simulate multiple treads, possibly by starting a second session for batch processing (generating a PDF or document conversions, etc.) or another form of simultaneous process?
[eluser]MASS MASS[/eluser]
One session for login users....... and another session for shopping cart( we are implementing shopping cart)
[eluser]tonanbarbarian[/eluser]
store all of the information in the one session Just make arrays of data in the session
[eluser]MASS MASS[/eluser]
Hi tonanbarbarian....... Yours is correct in case of registered users..........we can maintain in single session . what about in case of not register.....how to maintain session....
[eluser]tonanbarbarian[/eluser]
sessions do not HAVE to be used for just registered users. you can use a session to store any information you want if for example you want to store 2 things in the session, the user_id of the logged in user, and their favorite colour that they picked on one of the pages (just thought of anything for the second) You would store them in 2 seperate variabled in the session Code: $this->session->set_userdata('user_id', $user_id); So what I would do then is by default set the user_id to 0. Any user_id that is not 0 is for a registered user. This is fairly common practice
[eluser]Peter Ivanov[/eluser]
Look at http://www.captain.at/howto-php-sessions.php
[eluser]MASS MASS[/eluser]
I am creating two session .........i am getting that.....problem is (in case destroy session) as shown below user for login registration(first session ) for login.....following code uses $userdata_data = array( 'USER_ID' => 'asdfs34534', ); $this->session->set_userdata($userdata_data); ------------------------------------------------------------------- shopping cart products(second session) $products = array( 'products' => 'slkdfj4545', ); $this->session->set_userdata($products); ----------------------------------------------------------------- if i use $this->session->sess_destroy(); It will kill both sessions. so what to do to kill only users session......
[eluser]tonanbarbarian[/eluser]
Code: $userdata_data = array( ‘USER_ID’ => null, |
Welcome Guest, Not a member yet? Register Sign In |