Jump to content

session_start()


int21h

Recommended Posts

What would you like to happen?

 

My guess is nothing will happen except from the a session getting started.

 

Why have the multiple session_start() ?

 

<?php
session_start();
session_start();

?>

Link to comment
Share on other sites

you mean to say as in all of the pages or just the page needed to run the session. i thought the session will not expired unless specified. why is it that the all pages must have session_start?

 

session start needs to be on all pages that use the session's.

 

that it but it must be at the top off all pages ok.

 

<?php session_start();

?>

Link to comment
Share on other sites

The reason we put session start on all pages is to let the php.ini no that the session is

going also be used on that new page so in essance the session gets life exstention.

 

if the session start wasent there then there could be a chance that the session will go

dead and therefore all that information the user just typed in has all gone to wast.

 

yes it true a session will be set for a few seconds before going dead but we need it alive

while the user uses all our pages.

 

 

a session relies on cookies but has it own built in function for the

server to get the cookie infomation and place it in a file on your server.

 

 

if a user has cookies off then php will use it own function and cheek the

session file to see if there a set cookie for that browser if use it.

 

if you turn your cookies off your see the sid (session number) in the browser that

was created to the server session php file.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.