Skip to content

php could be incorrect with default setup. #218

andraskende opened this Issue Dec 22, 2011 · 7 comments

4 participants


line 57:

$config[''] = basename(LITHIUM_APP_PATH);

/Users/andras/Sites/ :
this works :
basename(LITHIUM_APP_PATH) = 'app'

/Users/andras/Sites/ :
this doesn't works :
basename(LITHIUM_APP_PATH) = '' probably the periods are causing issues with not saving etc...

This was confusing as it was working while having app folder :)

I figured to set the as below which works great:

// 'cookie' => array('adapter' => 'Cookie'),
'default' => array('adapter' => 'Php', '' => 'shop')

Wondering if the $config[''] should be changed to alphanumeric..

Thank you!!

mehlah commented Dec 22, 2011

Yep, I confirm that as I had the same issue #99 finally solved by setting manually a session name

Union of RAD member

Interesting. Might be good to use Inflector::slug() or something on it in that case. @gwoo, @daschl Thoughts?

Union of RAD member
daschl commented Dec 22, 2011

Looking at the documentation here `, it seems that only alphanumeric characters are allowed:

The session name references the name of the session, which is used in cookies and URLs (e.g. PHPSESSID). It should contain only alphanumeric characters; it should be short and descriptive (i.e. for users with enabled cookie warnings). If name is specified, the name of the current session is changed to its value.

Warning: The session name can't consist of digits only, at least one letter must be present. Otherwise a new session id is generated every time.

Slugs also allow and don't incorporate the additional warning so maybe we should write a string method for this?

mehlah commented Dec 22, 2011

What about making a default string like Lithium and add it to bootstrap/session.php config array with a short comment about accepted values, to invite users to set it manually.

If an additional method is added to util\String, it needs anyway a default string in case basename(LITHIUM_APP_PATH) is numeric (a timestamp in case of an automatic deployment).

Union of RAD member
daschl commented Dec 22, 2011

Jeah, I think a default string with proper override documentation is a good idea.

@nateabele ?

Union of RAD member

Well, I like the name of the cookie to automatically follow the name of the app. In either case, the override should be documented, but I lean towards using Inflector::slug() on the base name.


this was fixed at #225 closing issue

@andraskende andraskende closed this Jan 5, 2012
@gwoo gwoo added a commit that referenced this issue Jan 5, 2012
@gwoo gwoo Updating Php and Cookie Session adapters to use the basename of the L…
…ITHIUM_APP_PATH by defalt.

In the future, this default may be removed so we can also completely remove the LITHIUM_APP_PATH constant.
Please refer to commit to UnionOfRAD/framework@72d6673 for proper usage.
refs #225 and #218.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.