Hey All, I have made changes you have listed above and now it works. I have no idea what I was doing wrong.
Thanks for all the help On Dec 13, 11:56 am, Rishi <[email protected]> wrote: > Hi All > > Thanks for all the help. Here is what I have. > > 1. I am not using any Auth helper or component. I am simply trying to > query the database for the "username" & "password" and allowing the > user to login. Once I find the user. I am having the following code : > > if(!empty($user)){ > $this->Session->write('user',$user); > $this->redirect(array('controller' => > 'users', 'action' => > 'action')); > } > > 2. Once I redirect the user to the "action", I am trying to read the > session variable. > > $this->Session->read('user'); > I can read the session variable in the next immediately called > action. ( First action "Login" and second Action "Action"). > > 3. When I try to read the variable in the another action, I am losing > the variable. So when I read the session variable in action " > Preview" ( which is down the line not the immediate) I am losing the > "user" session variable.. > > 4. Thanks for the debug tool. I was able to track the session > variable. I can see session variable when I set it, but lost it the > consecutive actions (like the "Preview"). I am not using a shares > server, I am testing it on my local machine. I am using production > environment setting. I did try > > ini_set("session.cookie_domain", "yourdomain.com"); > But not use. > > 5. I have tried debug($this->Session) before and after reading the > session variable in the "action" action. > > -------------------------------- Before Reading > ------------------------------------------------ > SessionComponent Object > ( > [__active] => 1 > [__bare] => 0 > [__started] => 1 > [valid] => > [error] => Array > ( > [2] => Config.userAgent doesn't exist > ) > > [_userAgent] => > [path] => / > [lastError] => 2 > [security] => low > [time] => 1292259231 > [sessionTime] => 1292295231 > [cookieLifeTime] => > [watchKeys] => Array > ( > ) > > [id] => > [host] => localhost > [timeout] => > [enabled] => 1 > ) > > ------------------------------------------------------------------- > $this->Session->read('user'); > --------------------------------------------- After > ----------------------------------- > SessionComponent Object > ( > [__active] => 1 > [__bare] => 0 > [__started] => 1 > [valid] => > [error] => Array > ( > [2] => Config.userAgent doesn't exist > ) > > [_userAgent] => > [path] => / > [lastError] => 2 > [security] => low > [time] => 1292259231 > [sessionTime] => 1292295231 > [cookieLifeTime] => > [watchKeys] => Array > ( > ) > > [id] => > [host] => localhost > [timeout] => > [enabled] => 1 > ) > -------------------------------------------------------- > > 6. I can see my session varibale in the debug console. > > Thanks for all the help. !!!!!!! > > On Dec 13, 6:03 am, Renato de Freitas Freire <[email protected]> > wrote: > > > > > > > > > Try to put this code into your bootstrap.php file: > > > ini_set("session.cookie_domain", "yourdomain.com"); > > > You might be using a shared server... > > > -- > > Renato de Freitas Freire > > [email protected] > > > On Mon, Dec 13, 2010 at 6:37 AM, Jeremy Burns | Class Outfit < > > > [email protected]> wrote: > > > 1) Install the Debug Kit (https://github.com/cakephp/debug_kit) and > > > examine the contents of your session > > > 2) Are you loading both the Session component and the Session helper? > > > 3) How are you writing to and reading from the session (please show code)? > > > 4) What do you see when you die(debug($this->Session)); immediately before > > > and then immediately after writing to the session? > > > 5) What do you see when you die(debug($this->Session)); immediately before > > > and then immediately after reading from the session? > > > > Jeremy Burns > > > Class Outfit > > > > [email protected] > > >http://www.classoutfit.com > > > > On 13 Dec 2010, at 08:25, dtemes wrote: > > > > Without looking at your code nor knowing more about your environment I > > > guess it will not be easy to help you. > > > > Are you sure the code in your login action is being executed? (if > > > using auth check the autoRedirect variable) > > > > On 12 dic, 16:37, Rishi <[email protected]> wrote: > > > > Does anyone have any idea of what is going on !!!!! ...... its dealing > > > > with sessions. I really need some wayout. Please help !!! > > > > On Dec 10, 10:42 am, Rishi <[email protected]> wrote: > > > > Hi, > > > > No. I am not trying to switch between protocols. > > > > On Dec 8, 11:47 pm, Jeremy Burns | Class Outfit > > > > <[email protected]> wrote: > > > > Are yo switching between http and https? > > > > Jeremy Burns > > > > Class Outfit > > > > [email protected]http://www.classoutfit.com > > > > On 9 Dec 2010, at 02:43, Rishi wrote: > > > > Hi All, > > > > I am new Cakephp. I am using simple login mechanism ( not the standard > > > > Auth) for checking in user login. I set a session variable in the > > > > login action and try to access the variable in "graph" action. I am > > > > unable to read the variable. When I do a var_dump, i get NULL. I have > > > > tried all the options suggested by users in this group like setting > > > > security low/medium. Changed cake_session.php @ like 595 > > > > if(session_id() == '') { > > > > session_start(); > > > > } > > > > I am using CakePhp 1.3 and Php 5.2. > > > > I have been trying to get this up for past couple of days. Please help > > > > me to solve this problem.!!!!!! > > > > Check out the new CakePHP Questions > > > sitehttp://cakeqs.organdhelpotherswiththeirCakePHP related questions. > > > > You received this message because you are subscribed to the Google > > > Groups "CakePHP" group. > > > > To post to this group, send email to [email protected] > > > > To unsubscribe from this group, send email to > > > > [email protected] For more options, visit this group > > > athttp://groups.google.com/group/cake-php?hl=en > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 [email protected] > > > To unsubscribe from this group, send email to > > > [email protected] For more options, visit this group > > > athttp://groups.google.com/group/cake-php?hl=en > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp > > > 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 [email protected] > > > To unsubscribe from this group, send email to > > > [email protected]<cake-php%[email protected] > > > om>For more options, visit this group at > > >http://groups.google.com/group/cake-php?hl=en 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
