Session cookies

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Session cookies

goncalo.marrafa@gmail.com

Hi, All.

I'm having a problem with sessions, due to the cookies Cake uses to store
the session id. My app uses a lot of plugins, each one of them setting
a cookie with their own path.

The problem is that i'm storing the logged user's credentials in the
"main" session and sometimes (only sometimes!), when i try to access a
plugin's controller, the app "thinks" the user is not logged in!

Is this a feature? A bug? Can anyone help me with this?

Thanks in advance.

--
Gonçalo Marrafa <[hidden email]>

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" 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
|

Re: Session cookies

beamich@gmail.com

What operating system are you using? I use OS 10.4 and have recently
downloaded a software update for it which has cancelled my computer's
ability to carry session data from one page to the next. Let me know if
this maybe the problem.

Benz

Gonçalo Marrafa wrote:

> Hi, All.
>
> I'm having a problem with sessions, due to the cookies Cake uses to store
> the session id. My app uses a lot of plugins, each one of them setting
> a cookie with their own path.
>
> The problem is that i'm storing the logged user's credentials in the
> "main" session and sometimes (only sometimes!), when i try to access a
> plugin's controller, the app "thinks" the user is not logged in!
>
> Is this a feature? A bug? Can anyone help me with this?
>
> Thanks in advance.
>
> --
> Gonçalo Marrafa <[hidden email]>


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" 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
|

Re: Re: Session cookies

Samuel DeVore

we had a similar problem on a server update recently and it turned out
that the tmp folder was no longer writable.  Once the permissions
issue was corrected the problem was resolved.  You might check the
permissions at /tmp and /var/tmp and see if they have changed.  You
can also try changing your cake config to use the cake tmp rather then
the system one and see if this helps

Sam D

On 11/6/06, [hidden email] <[hidden email]> wrote:

>
> What operating system are you using? I use OS 10.4 and have recently
> downloaded a software update for it which has cancelled my computer's
> ability to carry session data from one page to the next. Let me know if
> this maybe the problem.
>
> Benz
>
> Gonçalo Marrafa wrote:
> > Hi, All.
> >
> > I'm having a problem with sessions, due to the cookies Cake uses to store
> > the session id. My app uses a lot of plugins, each one of them setting
> > a cookie with their own path.
> >
> > The problem is that i'm storing the logged user's credentials in the
> > "main" session and sometimes (only sometimes!), when i try to access a
> > plugin's controller, the app "thinks" the user is not logged in!
> >
> > Is this a feature? A bug? Can anyone help me with this?
> >
> > Thanks in advance.
> >
> > --
> > Gonçalo Marrafa <[hidden email]>
>
>
> >
>


--
==
S. DeVore
(the old fart) the advice is free, the lack of crankiness will cost you

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" 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
|

Re: Session cookies

goncalo.marrafa@gmail.com
In reply to this post by beamich@gmail.com


I'm using Linux, so i guess our problems aren't OS related.


On Mon, 06 Nov 2006 21:43:35 -0000
"[hidden email]" <[hidden email]> wrote:

>
> What operating system are you using? I use OS 10.4 and have recently
> downloaded a software update for it which has cancelled my computer's
> ability to carry session data from one page to the next. Let me know if
> this maybe the problem.
>
> Benz
>
> Gonçalo Marrafa wrote:
> > Hi, All.
> >
> > I'm having a problem with sessions, due to the cookies Cake uses to
> > store the session id. My app uses a lot of plugins, each one of them
> > setting a cookie with their own path.
> >
> > The problem is that i'm storing the logged user's credentials in the
> > "main" session and sometimes (only sometimes!), when i try to access a
> > plugin's controller, the app "thinks" the user is not logged in!
> >
> > Is this a feature? A bug? Can anyone help me with this?
> >
> > Thanks in advance.
> >
> > --
> > Gonçalo Marrafa <[hidden email]>
>
>
> >
>


--
Gonçalo Marrafa <[hidden email]>

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" 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
|

Re: Session cookies

goncalo.marrafa@gmail.com
In reply to this post by Samuel DeVore

I'm using PHP's native session management. I'll try Cake's and see if the
problems persists. Either way i don't think it is a permissions problem.
The session data files are there. The problem is that Cake creates a
different session/cookie for each plugin!

Thanks for your help.


On Mon, 6 Nov 2006 17:31:55 -0700
"Samuel DeVore" <[hidden email]> wrote:

>
> we had a similar problem on a server update recently and it turned out
> that the tmp folder was no longer writable.  Once the permissions
> issue was corrected the problem was resolved.  You might check the
> permissions at /tmp and /var/tmp and see if they have changed.  You
> can also try changing your cake config to use the cake tmp rather then
> the system one and see if this helps
>
> Sam D
>
> On 11/6/06, [hidden email] <[hidden email]> wrote:
> >
> > What operating system are you using? I use OS 10.4 and have recently
> > downloaded a software update for it which has cancelled my computer's
> > ability to carry session data from one page to the next. Let me know if
> > this maybe the problem.
> >
> > Benz
> >
> > Gonçalo Marrafa wrote:
> > > Hi, All.
> > >
> > > I'm having a problem with sessions, due to the cookies Cake uses to
> > > store the session id. My app uses a lot of plugins, each one of them
> > > setting a cookie with their own path.
> > >
> > > The problem is that i'm storing the logged user's credentials in the
> > > "main" session and sometimes (only sometimes!), when i try to access
> > > a plugin's controller, the app "thinks" the user is not logged in!
> > >
> > > Is this a feature? A bug? Can anyone help me with this?
> > >
> > > Thanks in advance.
> > >
> > > --
> > > Gonçalo Marrafa <[hidden email]>
> >
> >
> > >
> >
>
>
> --
> ==
> S. DeVore
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> >
>


--
Gonçalo Marrafa <[hidden email]>

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" 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
|

Re: Session cookies

AD7six

Hi Gonçalo,

Did you try this:
http://groups.google.com/group/cake-php/search?group=cake-php&q=session+plugin

If there is always a new session for each plugin there is a solution on
my site (see the results above), although I found that with an upgrade
the 'problem' went away. If it is, as you said originally, only
sometimes - can you quantify that, does the comment in the thread
"plugin cookie path changes from 1.1.6 to 1.1.7" apply?

Cheers,

AD7six
 Please note:
The manual/bakery is a good place to start any quest for info.
The cake search (at the time of writing) erroneously reports less/no
results for the google group.
The wiki may contain incorrect info - read at your own risk (it's
mainly user submitted) :)
You may get your answer quicker by asking on the IRC Channel (you can
access it with just a browser here: http://irc.cakephp.org).


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" 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
|

Re: Session cookies

goncalo.marrafa@gmail.com

Thanks Andy, you rock!

I was looking through the comments on your solution
(http://noswad.me.uk/MiBlog/SessionsAndPlugins) and truster presents an
alternate solution. Truster suggests setting CakeSession->path='/' and
ini_set('session.cookie_path', '/') in beforeFilter(). Correct me if i'm
wrong but by then isn't the session already initialized? Shouldn't that be
done _before_ session starts?

Thanks again for your help.


On Tue, 07 Nov 2006
14:52:38 -0000 "AD7six" <[hidden email]> wrote:

>
> Hi Gonçalo,
>
> Did you try this:
> http://groups.google.com/group/cake-php/search?group=cake-php&q=session+plugin
>
> If there is always a new session for each plugin there is a solution on
> my site (see the results above), although I found that with an upgrade
> the 'problem' went away. If it is, as you said originally, only
> sometimes - can you quantify that, does the comment in the thread
> "plugin cookie path changes from 1.1.6 to 1.1.7" apply?
>
> Cheers,
>
> AD7six
>  Please note:
> The manual/bakery is a good place to start any quest for info.
> The cake search (at the time of writing) erroneously reports less/no
> results for the google group.
> The wiki may contain incorrect info - read at your own risk (it's
> mainly user submitted) :)
> You may get your answer quicker by asking on the IRC Channel (you can
> access it with just a browser here: http://irc.cakephp.org).
>
>
> >
>


--
Gonçalo Marrafa <[hidden email]>

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups "Cake PHP" 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
-~----------~----~----~----~------~----~------~--~---