Quantcast

how to write data into session in the view

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

how to write data into session in the view

robert123-2

Hi,

I am trying to write some data into the session object at the view,
below is the statement, but it will write into it session, anyone can
help? Thanks

$session->write('Config.language', 'data');



www.generics.ws
www.genericsmed.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to write data into session in the view

robert123-2



 I am trying to write some data into the session object at the view,
 below is the statement, but it will not write into it session, anyone
can
 help? Thanks


On May 25, 8:28 am, robert123 <[hidden email]> wrote:
> Hi,
>
> I am trying to write some data into the session object at the view,
> below is the statement, but it will write into it session, anyone can
> help? Thanks
>
> $session->write('Config.language', 'data');
>
> www.generics.ws
www.genericsmed.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to write data into session in the view

b logica

I doubt that the view is the best place for this. Do you have a
compelling reason? Maybe there's a way to do what you want in the
controller.

Also, are you sure you want 'Config.language'? Unless you're setting
the locale, you really should choose a different name, unless you're
not using Cake's localisation classes.

On Sat, May 24, 2008 at 8:29 PM, robert123 <[hidden email]> wrote:

>
>
>
>  I am trying to write some data into the session object at the view,
>  below is the statement, but it will not write into it session, anyone
> can
>  help? Thanks
>
>
> On May 25, 8:28 am, robert123 <[hidden email]> wrote:
>> Hi,
>>
>> I am trying to write some data into the session object at the view,
>> below is the statement, but it will write into it session, anyone can
>> help? Thanks
>>
>> $session->write('Config.language', 'data');
>>
>> www.generics.ws
> www.genericsmed.com
> >
>

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

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to write data into session in the view

robert123-2

Thank you for the reply,

I dont have much choice regarding this, I know it is a bad place to
write session data in the view

But because the this is a multilanguage website with caching, hence it
will not goes to the controller,

but at the view there is some no cache tag to record which locale the
user is currently in and it has to be stored in the session.

So I need to store data into session at the view page, thank you

On May 25, 11:05 am, "b logica" <[hidden email]> wrote:

> I doubt that the view is the best place for this. Do you have a
> compelling reason? Maybe there's a way to do what you want in the
> controller.
>
> Also, are you sure you want 'Config.language'? Unless you're setting
> the locale, you really should choose a different name, unless you're
> not using Cake's localisation classes.
>
> On Sat, May 24, 2008 at 8:29 PM, robert123 <[hidden email]> wrote:
>
> >  I am trying to write some data into the session object at the view,
> >  below is the statement, but it will not write into it session, anyone
> > can
> >  help? Thanks
>
> > On May 25, 8:28 am, robert123 <[hidden email]> wrote:
> >> Hi,
>
> >> I am trying to write some data into the session object at the view,
> >> below is the statement, but it will write into it session, anyone can
> >> help? Thanks
>
> >> $session->write('Config.language', 'data');
>
> >>www.generics.ws
> >www.genericsmed.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Loading...