Sunday, August 1, 2010

Re: session is not working between different actions on different controllers

Hi all,

thanks for all your responses.

i think perhaps my situation was worded a bit wrongly. hence most
responses seem to be saying i am trying to access session variables of
1 cake app from another.

actually, i should emphasize that when i said the carts/add will set a
session value, this refers to

the cake app localhost/checkout 's carts/add setting a session
variable for its own app. ie localhost/checkout.

subsequently in the SAME app a different controller/action ie orders/
pay will attempt to read the session variable. which curiously is no
longer existing.

anyway, i resolved the whole situation by ironically enough, using
database for SESSION and then passing the session variable from 1 app
to another via the database

it was more sophisticated than what i was originally trying to do ,
but hey, that is life right? i am sure even excellent google apps have
1 or 2 workarounds. :)

Thank you all for your answers.

If anyone is able to point out to me why the original way cannot work,
or make the original way work, i will be greatly grateful.

On Aug 1, 1:58 pm, "Dr. Loboto" <drlob...@gmail.com> wrote:
> PLUS there is need to pass session ID via URL. As cookies works ONLY
> for one domain.
>
> On Jul 31, 3:52 am, Beavis de Milo <wig...@gmail.com> wrote:
>
>
>
> > DragonFlyEye - Isn't what Kei is attempting possible using database
> > sessions?  He could store the DB session in the default database and
> > each seperate app could have it's own private DB for data.
>
> > On Jul 30, 12:25 pm, DragonFlyEye <dragonflyey...@gmail.com> wrote:
>
> > > Well, you're not going to be able to maintain a standard session
> > > across multiple domains. That's basic to sessions and cookies. You can
> > > certainly create some sort of non-visible login system (like a GET
> > > variable) that allows the user to see the same things on two domains,
> > > but a literal session across two domains is definitely not going to
> > > work.
>
> > > This is less about CakePHP and more about sessions and cookies as a
> > > broad subject, not really fit for this list. I suggest you do a bit of
> > > research on the topic before getting in too deep.
>
> > > On Jul 30, 11:15 am, Kei Simone <kimc...@gmail.com> wrote:
>
> > > > Hi there,
>
> > > > the idea is that i am doing something like an ecommerce platform for
> > > > merchants.
>
> > > > there are 2 apps because i want the shopping site to be on 1 domain
> > > > and the checkout pages to be on another domain.
>
> > > > so that i can use ssl on the checkout pages and that this is
> > > > consistent for ALL customers who buy stuff from different merchants.
>
> > > > > 1. Localhost can often be a tricky thing for cookies and sessions.
> > > > > Make sure those addresses are really the way content is being served
> > > > > up to the browser.
>
> > > > i dont quite get this point. what do you mean by make sure the
> > > > addresses are really the way content is being served?
>
> > > > > 2. Cookie settings in Configure::write(): make sure they're set for
> > > > > the exact same location, not /checkout and /wp
>
> > > > i am just confused about this suggestion.
>
> > > > On Jul 30, 10:58 pm, DragonFlyEye <dragonflyey...@gmail.com> wrote:
>
> > > > > Why two separate applications for this? Is one not CakePHP?
>
> > > > > Offhand, here's a few things:
> > > > > 1. Localhost can often be a tricky thing for cookies and sessions.
> > > > > Make sure those addresses are really the way content is being served
> > > > > up to the browser.
> > > > > 2. Cookie settings in Configure::write(): make sure they're set for
> > > > > the exact same location, not /checkout and /wp
>
> > > > > On Jul 30, 10:48 am, Kei Simone <kimc...@gmail.com> wrote:
>
> > > > > > Hi all,
>
> > > > > > i have 2 cake apps. localhost/wp and localhost/checkout. wp sends a
> > > > > > httpsocket->post to localhost/checkout/carts/add and gets a result.
> > > > > > the carts/add will set a session value. wp will use the result of the
> > > > > > post and redirects to paypalsandbox. after that the paypalsandbox will
> > > > > > redirect to localhost/checkout/orders/pay. however in orders/pay it
> > > > > > cannot find the session written in carts/add
>
> > > > > >http://picasaweb.google.com/lh/photo/o_Ylvp3uqtQer-d5HC9Lgg?feat=dire...
> > > > > > describes my situation
>
> > > > > > i have tried setting security to low
>
> > > > > > changing to database for my session
>
> > > > > > changing to custom handler where the referer_check is empty string
>
> > > > > > change session cookiename
>
> > > > > > change checkAgent to false
>
> > > > > > so if you have any other methods, please please tell me.
>
> > > > > > i am really stuck.
>
> > > > > > i am not sure if this is due to the paypal page redirecting? or due to
> > > > > > the fact that the place where i first write the session value i am
> > > > > > used a httpsocket post.
>
> > > > > > Please advise. thank you.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: