Jump to content

[ASK] HOW to sett session expired??


nicx

Recommended Posts

I have a session like this:

page1.php

<?php
session_start();
$_SESSION['Start'] = 1;
?>

page2.php

<?php
session_start();
if($_SESSION['Start'] != 1){
echo "You ain't suppose to be here";
}
else{
#display page
}
?>

bro,how to write the link to connect page2 with

<? echo "<a href=..."; ?  ?> 

what i must add behind the original url and is the url shown on address bar become http://domain.com/page2.php?sid=xxxx...?

Because i was make sid like that but that not show url like i want that show domain.com/page2.php?PHPSESID=xxxx. How?

And how to sett session expired to 20minutes?

Link to comment
Share on other sites

Can you try this:

 

<? echo "<a href=\"page2.php?" . htmlspecialchars(SID). "\">click here</a>"; 

 

The "." separates the echoed strings and the call to htmlspecialchars().  Otherwise php will not understand the call.

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.