CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 loosing PHP-session

Print topic Send  topic

Author Message
Tobias Weik
Posted: 11/18/2002, 3:38 PM

hi all,

I created a good working CCS-app with PHP but now got this problem: I
want to open a PHP-webmail in a blank window from my CCS-app as a
logged-in user, but when I click the link to the webmail my primary
session (for my own app) gets lost, telling me I am not logged-in
anymore... what the hell am I doing wrong?

please help... thanks
tobias
RonB
Posted: 11/18/2002, 4:16 PM

On Tue, 19 Nov 2002 00:38:54 +0100, Tobias Weik wrote:

> hi all,
>
> I created a good working CCS-app with PHP but now got this problem: I
> want to open a PHP-webmail in a blank window from my CCS-app as a
> logged-in user, but when I click the link to the webmail my primary
> session (for my own app) gets lost, telling me I am not logged-in
> anymore... what the hell am I doing wrong?
>
> please help... thanks
> tobias

Did you check the persisten connection checkbox (in the server tab under
connections). Shouldn't make any difference but maybe re-using an
existing session would solve your problem. In principle a new connection
should have been made without dropping another one. Maybe some
adjustments in the php.ini file?

RonB
Tobias Weik
Posted: 11/18/2002, 5:10 PM

RonB wrote:

> Did you check the persisten connection checkbox (in the server tab under
> connections). Shouldn't make any difference but maybe re-using an
> existing session would solve your problem. In principle a new connection
> should have been made without dropping another one. Maybe some
> adjustments in the php.ini file?

hi RonB,

I allways thought the persistant connection checkbox is for the way I
connect to the database? The new window/app with the webmail I want to
open doesnīt use any db-connect...

I also took a look at the php.ini and modyfied the [Session]-part, since
there was "session.use_trans_sid" set to "1" ( I am using the
e-smith.org SME Linux-Server 5.5 as devel- and productionsystem), but
this also didnīt solve it (and yes, I restarted the server ;)

I agree with you that a new connection should have been created when
opening a second PHP-app, but instead the new connection stil takes over
my old session and then drops it :(

But this doesnīt look like a CCS problem, since I just tried it with two
other (non-CCS) applications and had the same problem - thanx anyway,
you pointed me the right way :))
Kasper Pedersen
Posted: 12/03/2002, 6:43 AM

The problem is that your session id is stored in a cookie, which has a
default expiry date of 0. When a new window opens in IE, the cookie isn't
passed along because its outdated ... hmmm ... strange ?!?!

In common.php the following code should be added after
.....
session_start();
....

// FIX-START
$expiry = 60*60*24*100; // 100 days
setcookie(session_name(), session_id(), time()+$expiry, "/");
// FIX-END

Source:
http://www.php.net/manual/en/ref.session.php
http://www.php.net/manual/en/function.session-set-cookie-params.php

Best regards
Kasper Pedersen




"Tobias Weik" <tw@internet2go.de> wrote in message
news:arbtli$3re$1@news.codecharge.com...
> hi all,
>
> I created a good working CCS-app with PHP but now got this problem: I
> want to open a PHP-webmail in a blank window from my CCS-app as a
> logged-in user, but when I click the link to the webmail my primary
> session (for my own app) gets lost, telling me I am not logged-in
> anymore... what the hell am I doing wrong?
>
> please help... thanks
> tobias
>

Tobias Weik
Posted: 12/04/2002, 6:37 AM

Kasper Pedersen schrieb:

> In common.php the following code should be added after
> ....
> session_start();
> ...
>
> // FIX-START
> $expiry = 60*60*24*100; // 100 days
> setcookie(session_name(), session_id(), time()+$expiry, "/");
> // FIX-END

Hi Kasper,

your fix didnīt solve it, BUT - you pointed me the right way: It works, if the
session is named! Just add "session_name("");" before "session_start();" - my
fix now looks like this:

session_name("MySessionName");
session_start();
....
(no other fix needed!)

Thanx a lot for the hint! Regards,

Tobias

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright Đ 2003-2004 by UltraApps.com  and YesSoftware, Inc.