Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] sessionless version for usage in clouds #2

Closed
panique opened this issue Jun 10, 2012 · 7 comments
Closed

[ENHANCEMENT] sessionless version for usage in clouds #2

panique opened this issue Jun 10, 2012 · 7 comments

Comments

@panique
Copy link
Owner

panique commented Jun 10, 2012

No description provided.

@panique
Copy link
Owner Author

panique commented Apr 26, 2013

this will be available in the "2-full" version/folder

@panique
Copy link
Owner Author

panique commented May 31, 2013

Just some info on that: This script uses the php $_SESSION, which "is a file" on the server that temporarely saves information about the user's login status. That's the way a login script works (there are alternatives, but don't let's discuss this here). Problem is, that in cloud applications, the entire app is copied 1:1 to serveral servers automatically to handle big loads/traffic/blabla... So when you enter the app as a user, you are automatically directed to server A, B or C, depending on the load of the servers. The database is usally on another server, let's say D. Now, when you login into the app, maybe on server A, do something and maybe come back to the app 30 minutes later, it's possible that the servers/apps load balancer sends you to server B next time. Problem here: your $_SESSION exists on server A (where you logged in and the session was created) but not on server B. This is a known problem, and it would be interesting to bring up a proper solution.

Note: Some cloud services share the file system for your app, so server a/b/c will have the same php session folder. Some others don't !

@panique
Copy link
Owner Author

panique commented May 31, 2013

@noodlehaus
Copy link

not really guaranteed. maybe it would be better if it would depend on availability of either memcache or redis, and only enable shared sessions if those session servers are define()ed or configured.

@panique
Copy link
Owner Author

panique commented Jun 22, 2013

Notice: Works in Google App Engine, as they save in memory: https://developers.google.com/appengine/docs/php/#Sessions

It's also possible to completely change the way sessions are saved (disk, memory, database) by using alternative/own session functions. This might be interesting for people hosting massive apps in clouds: http://php.net/manual/en/function.session-set-save-handler.php

@panique
Copy link
Owner Author

panique commented Jul 12, 2013

I think it's better to close this ticket as this is a high-end edge case problem and not really a topic for a SIMPLE login system. People who really spread their app over multiple servers know what they are doing and have probably a better solution than we would find here...

@panique panique closed this as completed Jul 12, 2013
@panique
Copy link
Owner Author

panique commented Jul 31, 2013

Excellent library for this issue: https://github.com/sprain/PHP-MySQL-Session-Handler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants