Storing session variables with PHP’s native sessions
Posted: 07 April 2008 02:32 PM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  251
Joined  09-29-2007

Sometimes you may want to temporarily store a variable for a short amount of time without writing a value to the database. Expression Engine’s sessions do not allow this, however PHP’s native sessions do.

This plugin allows you to use PHP’s native session variables.

http://www.putyourlightson.net/projects/session_variables

 Signature 

* Get FireMail for EE 2.0 and manage and track emails in real-time. Get the Sitemap Module and improve your site’s SEO

More Add-ons: Multi Language, Exchange Rates, Stand-Alone Image Editor, Landing Page, iWebApp, LogMeIn, Loop Plugin, Session Variables

Profile
 
 
Posted: 12 May 2008 04:57 AM   [ Ignore ]   [ # 1 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Hi Ben,

Can’t believe this one slipped me by! Looks really handy. Going to check it out now. Thanks for all the great items you make for ExpressionEngine, they are really great.

Just to echo the sentiments of Julien on your comments on your site it would be great if you could somehow loop over items to add and retrieve from the sessions. This could then possibly be the basis of a sort of shopping cart or something like that? At the moment you would have to name the variables with a counter or something and track the count I suppose?

Anyway thanks for this as I am going to try it out right away.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 12 May 2008 05:01 AM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  251
Joined  09-29-2007

cheers mark, i appreciate it!

i find this one really handy, though i think most people haven’t really considered the possible uses of it.  only thing that bugs me sometimes is that the default lifetime of a php session is 24 minutes

 Signature 

* Get FireMail for EE 2.0 and manage and track emails in real-time. Get the Sitemap Module and improve your site’s SEO

More Add-ons: Multi Language, Exchange Rates, Stand-Alone Image Editor, Landing Page, iWebApp, LogMeIn, Loop Plugin, Session Variables

Profile
 
 
Posted: 12 May 2008 05:20 AM   [ Ignore ]   [ # 3 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10835
Joined  04-15-2006

Yep 24 minutes does seem a little odd although luckily on the server I am on I have full control over that sort of thing so would probably set it a lot higher than that.

Any thoughts on doing something like a shopping cart with this. What I mean to say is how hard would it be to add items to say something like an array in a session so that you can then just pull them all back at the end to show them in the cart and then send them off to say PayPal with the correct information?

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 12 May 2008 05:27 AM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  251
Joined  09-29-2007

no reason why that wouldn’t work.  i reckon a cookie might be better though so that next time the visitor comes to the site their cart contents will still be there.  plus the lifetime of a cookie can be set to anything, including never-ending

 Signature 

* Get FireMail for EE 2.0 and manage and track emails in real-time. Get the Sitemap Module and improve your site’s SEO

More Add-ons: Multi Language, Exchange Rates, Stand-Alone Image Editor, Landing Page, iWebApp, LogMeIn, Loop Plugin, Session Variables

Profile
 
 
Posted: 15 June 2009 05:05 PM   [ Ignore ]   [ # 5 ]  
Research Assistant
RankRankRank
Total Posts:  511
Joined  11-05-2006

I’m getting an error:

Cannot send session cookie - headers already sent by (output started at /path.php:14) in pi.session_variables.php on line 48
Profile
 
 
Posted: 01 March 2010 07:24 PM   [ Ignore ]   [ # 6 ]  
Summer Student
Total Posts:  26
Joined  01-30-2010

Hi there,

The plugin is not showing up in my plugin list.  I’ve got plenty of other plugins installed correctly in EE2.0, but this one isn’t appearing.

Thanks.

Profile
 
 
Posted: 01 March 2010 07:29 PM   [ Ignore ]   [ # 7 ]  
Summer Student
Total Posts:  26
Joined  01-30-2010

Sorry.  Problem solved.

For some reason, permissions were not set correctly on that upload.  All is well.

Thanks for the plugin!

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 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120601 Total Logged-in Users: 73
Total Topics: 126640 Total Anonymous Users: 36
Total Replies: 665696 Total Guests: 410
Total Posts: 792336    
Members ( View Memberlist )