Part of the EllisLab Network
   
 
phpsession, my session data is empty?
Posted: 26 August 2006 07:44 AM   [ Ignore ]  
Summer Student
Total Posts:  8
Joined  08-16-2006

(re) Hi !

I’m experiencing a new problem with phpsession (which I use ‘cause I need to store session datas serverside).

I’ve got a controller, which filename is Manager.php

This controller has several functions.
The first one, index() store a session data using phpsession. Here is the code I used :

$this->phpsession->save('sess_log', 'ok');

So the name of the session data is ‘sess_log’ and its value is ‘ok’.

When a visitor goes to mywebsite/manager/ a that sess_log data should be stored in the session datas.

Now from another function (which name is infos() ) in my Manager controller, which is executed when the visitor cliks on a mywebsite/manager/infos link, I’d like to retrieve the sess_log data using that code :

$this->phpsession->get('sess_log');

And it just doesn’t work. sess_log session data seems to be empty.

Any idea of what’s happening?

Thanks in advance for your help.

Profile
 
 
Posted: 26 August 2006 11:29 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  424
Joined  04-03-2006
setblue - 26 August 2006 07:44 AM

I’m experiencing a new problem with phpsession (which I use ‘cause I need to store session datas serverside).

Native_session also offers serverside storage while being api compatable with CI_Session.

can offer session use examples in my mini-app

 Signature 

George Dunlop - This-Page.com

Profile
 
 
Posted: 26 August 2006 01:30 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  8
Joined  08-16-2006

Ok, thanks for your answer, I’ll check your app. smile

But anyway, do you have any clue about the error I get from my use of phpsession? Am I doing soemthing wrong?

Profile
 
 
Posted: 26 August 2006 03:14 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  424
Joined  04-03-2006
setblue - 26 August 2006 01:30 PM

Ok, thanks for your answer, I’ll check your app. smile

But anyway, do you have any clue about the error I get from my use of phpsession? Am I doing soemthing wrong?

Your code looks correct but your file name should be lowercase ie controllers/manager.php nothing else jumps out as odd.

Edit: try

echo $this->phpsession->get('sess_log');
 Signature 

George Dunlop - This-Page.com

Profile
 
 
Posted: 27 August 2006 04:21 AM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  8
Joined  08-16-2006

In fact the filename of my controller is lowercase.

I think I know why my session data remains empty.
I just remembered that yesterday but 2 weeks ago, I’ve made some changes in my php.ini file. Among these changes, I’ve set session.use_trans_sid to 1… This option allow PHPSESSID to be added to the URL.
With CI I think it can’t work because of the way URL are displayed and used.

Edit : I’ve noticed that with session.use_trans_sid enabled, scaffolding can’t work too : the PHPSESSID is written in an hidden input of every forms which prevent scaffolding from working properly.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120177 Total Logged-in Users: 56
Total Topics: 126306 Total Anonymous Users: 4
Total Replies: 664267 Total Guests: 491
Total Posts: 790573    
Members ( View Memberlist )