Welcome!
餃
閮餃
蝢撖園
蝢撖嗥曄
蝢撖嗉憯
蝢撖嗉賣
蝢撖嗅啣
擐
>
摮豢雄 / Cultivation Career
>
摮賊 Academy
>
蝘摮
>
蝘
>
鞈閮
>
蝔撘閮剛
>
PHP
Advanced
PHP
雿:
銝餅:
Tags:
Message:
Hsinping Wrote: ------------------------------------------------------- > A quick suggestion, if you encountered problems > setting cookies in Google Chrome, is: > > Change your original setting for subdomains > > > setcookie('session', $session_key, $timeout, > '/', '.domain.com' ); > > To > > setcookie('session', $session_key, $timeout, > '/'); > > > This could make things easier. > > My personal experience is, HOW YOU CREATE A COOKIE > IS THE WAY YOU DELETE THE COOKIE. > > (If you set the cookie in NULL domain setting, you > should use NULL domain to delete it.) > > And, use the embedded Chrome tool > (F12->Recources->Cookies) to check your cookies. I > suggest to check if the cookies are the same in > www.domain.com and domain.com (or xxx.domain.com). > In the cases I encountered, they were simply > DIFFERENT. > > -- > > My scenario is making some changes in the > session/login management (for the cross-domain > stuff). Originally, I use the same setcookie > setting in session restore and session create, > like > > setcookie('session', $session_key, $timeout, > '/', '.domain.com' ); > > But, I changed the setting in session restore to > > setcookie('session', $session_key, $timeout, > '/') > > Any things go wrong after that. > > > If my memory and interpretation are right, I guess > the cookies set in NULL domain are SUPERIOR than > those set in other domain settings. So once you > set a cookie in NULL domain, you cannot > delete/modify the cookie in other means. > > If you set different cookies in .domain.com and > domain.com (I main NULL), only the cookie set in > NULL domain takes effect in domain.com. The one > set in .domain.com (only) work in www.doamin.com. > > So in my case, I set cookie in NULL domain in > LOGIN (session create) and set in .domain.com in > SESSION RESTROE. This (hoplefully) can make > cookies work fine in all scenarios.