LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-08-2006, 03:19 AM   #1
firetankiee1
LQ Newbie
 
Registered: Apr 2006
Posts: 12

Rep: Reputation: 0
[php] session_start() <-- not logical, burdensome


As most of guys would know,
as long as session-cookie on the client is alive,
regardless of deleteing a session file on the server side,
session_start() function always regenerate the same session id
which previously was used.

so ppl solve this problem, by
=> setcookie(session_name(),"","")
something like this...

but, the solution is very dependent of the client side.
what if the cookie isn't really dead, as opposite to ur guess.
then if u do session_start() again, the same session id would
be revived.

my point is when u initiate session by using session_start(),
u should make sure that the session id must be created by server
side, and not regenerated by client.

so i am asking, what do u guys think of the following??

(soluion A).
session_set_cookie_params(1,'/');
session_start();
session_destory(); <-- a record is deleted from session db clearly
session_set_cookie_params(0,'/');
session_start();

(solution B)
Generate random session name,
instead of using only PHPSESSID.

Last edited by firetankiee1; 05-08-2006 at 03:40 AM.
 
Old 05-08-2006, 04:05 AM   #2
firetankiee1
LQ Newbie
 
Registered: Apr 2006
Posts: 12

Original Poster
Rep: Reputation: 0
i think my question above is sort of stupid..
now i am looking at a function, session_id,.....

by the way, anyone know, how can i make session cookie in the memory of client's browser, not in a file???
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I have a logical error here. Dutchman Programming 2 06-15-2005 10:25 PM
I did not know about logical volumes gezi Linux - Newbie 5 04-27-2005 09:26 AM
Primary vs Logical djgerbavore Linux - Hardware 2 08-16-2004 06:02 PM
FAT32 logical 2damncommon Linux - General 7 06-01-2004 07:53 AM
PHP: Call to undefined function: session_start() wellmt Linux - Newbie 2 06-01-2004 05:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration