Discussion:
sessions and wordpress
Haluk Karamete
2013-11-15 11:59:48 UTC
Permalink
Hello,

Are the important consequences of using Sessions in WordPress?
If there are, could someone elaborate the most vital things to in a few
sentences..

At the top of my head, I am thinking there might be some issues with
Sessions as far as scalability, code performance, multisite, or multiple
servers configurations... Not sure, if these concerns are valid though...

And in general, is avoiding the sessions considered "best-practice" in the
WordPress world?

as always, this question pertains to sites that gets heavy traffic.
Mika A Epstein
2013-11-15 15:27:45 UTC
Permalink
PHP Sessions?

You massively screw up anyone with Varnish Caching for one (PHP Sessions
effectively tells Varnish "No, bro, you don't need to cache, so lemme
load up like a logged in user!")
Post by Haluk Karamete
Hello,
Are the important consequences of using Sessions in WordPress?
If there are, could someone elaborate the most vital things to in a few
sentences..
At the top of my head, I am thinking there might be some issues with
Sessions as far as scalability, code performance, multisite, or multiple
servers configurations... Not sure, if these concerns are valid though...
And in general, is avoiding the sessions considered "best-practice" in the
WordPress world?
as always, this question pertains to sites that gets heavy traffic.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Haluk Karamete
2013-11-15 16:22:59 UTC
Permalink
Sure that's a big one Mike.
I'd like to hear more problems with sessions though. I'm just building a
case study on why sessions should be avoided as far as WordPress goes.
Post by Mika A Epstein
PHP Sessions?
You massively screw up anyone with Varnish Caching for one (PHP Sessions
effectively tells Varnish "No, bro, you don't need to cache, so lemme load
up like a logged in user!")
Post by Haluk Karamete
Hello,
Are the important consequences of using Sessions in WordPress?
If there are, could someone elaborate the most vital things to in a few
sentences..
At the top of my head, I am thinking there might be some issues with
Sessions as far as scalability, code performance, multisite, or multiple
servers configurations... Not sure, if these concerns are valid though...
And in general, is avoiding the sessions considered "best-practice" in the
WordPress world?
as always, this question pertains to sites that gets heavy traffic.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Otto
2013-11-15 17:34:53 UTC
Permalink
It's not really a question of WordPress specifically. PHP sessions have
rather poor support on various hosting systems, as I discovered the hard
way. There's also caching issues and so forth.

If you're making code for your own site, where you control the setup and
configuration, then that's one thing. But making code designed to be used
across lots of different sites and configurations and setups is a slightly
different story.

-Otto
Post by Haluk Karamete
Sure that's a big one Mike.
I'd like to hear more problems with sessions though. I'm just building a
case study on why sessions should be avoided as far as WordPress goes.
Post by Mika A Epstein
PHP Sessions?
You massively screw up anyone with Varnish Caching for one (PHP Sessions
effectively tells Varnish "No, bro, you don't need to cache, so lemme
load
Post by Mika A Epstein
up like a logged in user!")
Post by Haluk Karamete
Hello,
Are the important consequences of using Sessions in WordPress?
If there are, could someone elaborate the most vital things to in a few
sentences..
At the top of my head, I am thinking there might be some issues with
Sessions as far as scalability, code performance, multisite, or multiple
servers configurations... Not sure, if these concerns are valid
though...
Post by Mika A Epstein
Post by Haluk Karamete
And in general, is avoiding the sessions considered "best-practice" in
the
Post by Mika A Epstein
Post by Haluk Karamete
WordPress world?
as always, this question pertains to sites that gets heavy traffic.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Nikola Nikolov
2013-11-15 17:37:53 UTC
Permalink
How would you handle data like a shopping cart?

I'm just curious what other options you have that would be okay to use.
Would you store the session data in the database maybe? I know storing it
in a cookie is not an overly good idea.
Post by Otto
It's not really a question of WordPress specifically. PHP sessions have
rather poor support on various hosting systems, as I discovered the hard
way. There's also caching issues and so forth.
If you're making code for your own site, where you control the setup and
configuration, then that's one thing. But making code designed to be used
across lots of different sites and configurations and setups is a slightly
different story.
-Otto
Post by Haluk Karamete
Sure that's a big one Mike.
I'd like to hear more problems with sessions though. I'm just building a
case study on why sessions should be avoided as far as WordPress goes.
Post by Mika A Epstein
PHP Sessions?
You massively screw up anyone with Varnish Caching for one (PHP
Sessions
Post by Haluk Karamete
Post by Mika A Epstein
effectively tells Varnish "No, bro, you don't need to cache, so lemme
load
Post by Mika A Epstein
up like a logged in user!")
Post by Haluk Karamete
Hello,
Are the important consequences of using Sessions in WordPress?
If there are, could someone elaborate the most vital things to in a
few
Post by Haluk Karamete
Post by Mika A Epstein
Post by Haluk Karamete
sentences..
At the top of my head, I am thinking there might be some issues with
Sessions as far as scalability, code performance, multisite, or
multiple
Post by Haluk Karamete
Post by Mika A Epstein
Post by Haluk Karamete
servers configurations... Not sure, if these concerns are valid
though...
Post by Mika A Epstein
Post by Haluk Karamete
And in general, is avoiding the sessions considered "best-practice" in
the
Post by Mika A Epstein
Post by Haluk Karamete
WordPress world?
as always, this question pertains to sites that gets heavy traffic.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Nicholas Ciske
2013-11-15 17:41:09 UTC
Permalink
If you need session-like storage in a plugin:

GitHub: https://github.com/ericmann/wp-session-manager

See Pippins review about his use in Easy Digital Downloads:
http://wordpress.org/support/view/plugin-reviews/wp-session-manager

_________________________
Nick Ciske
http://thoughtrefinery.com/
@nciske
Post by Nikola Nikolov
How would you handle data like a shopping cart?
I'm just curious what other options you have that would be okay to use.
Would you store the session data in the database maybe? I know storing it
in a cookie is not an overly good idea.
Hal Burgiss
2013-11-15 17:52:23 UTC
Permalink
Post by Nikola Nikolov
How would you handle data like a shopping cart?
I'm just curious what other options you have that would be okay to use.
Would you store the session data in the database maybe? I know storing it
in a cookie is not an overly good idea.
You can define the session handler. You can use mysql or memcached for
instance, to handle load balancer type issues.

Continue reading on narkive:
Loading...