Thread

Posted on Wed Jun 13 10:38:43 2007 by alagappan
Change of Session Id when refreshing the Page
Dear Cees, I currently face 2 problems. Problem 1 Instead of writing
$class->redirect()
If I specify a sub routine inside the same pm file, only one session id gets created. But I definitely have to redirect to an other url. Is it possible for me to redirect without clobbing the existing header Problem 2 In the cgiapp_init subroutine, when specifying the CGI_SESSION_OPTIONS Instead of giving
$self->query
, I tried to pass the existing session id in the database for eg. 0a..df
CGI_SESSION_OPTIONS => ["driver:PostgreSQL", "0a..df", {Handle => $dataBase}]
and now when I refresh the page it does not create a new session id and uses the existing session id. What could be the reason for this?
Direct Responses: 5445 | Write a response
Posted on Fri Jun 15 07:21:45 2007 by ceeshek in response to 5430
Re: Change of Session Id when refreshing the Page

A redirect can cause problems if you are first creating a session and sending the Cookie to the browser. Some browsers are known to ignore cookies that are sent along with a redirect header. Your best bet is to make sure the session gets created on a page that doesn't require a redirect. For example make sure when you display the login page that the session is created at that stage. Then when the user submits the login form, the session already exists, and you can add in your login tokens into the session and then redirect without any worries.

As for the second problem, you should not have to do any of that. Your best bet is to remove the CGI_SESSION_OPTIONS completely and let the Session plugin use its defaults. It should work properly without any configuration.

Hope that helps...

Cheers,

Cees

Write a response