Jump to content


new session after every refresh?

  • Please log in to reply
3 replies to this topic

#1 b3njo



  • Joined: 01-December 01

Posted 03 November 2004 - 04:04

hi all, is it possible to have a new session each time a user refresh the page? here's the code i'm using right now, but it doesnt work:

$_SESSION['sid'] = session_id();

html :
<?php echo $_SESSION['sid']; 


What is wrong with my code? :blush:

#2 Endoscient



  • Joined: 04-November 01

Posted 03 November 2004 - 04:31

the problem with your code is that you are just unsetting a normal variable that u happen to set as the session id. I dont get what you are trying to do with this anyway... that defeats the point of a session.

if u want a new session id jsut do this



#3 chuayw2000


    Ace's brother

  • Joined: 12-July 03
  • Location: Singapore

Posted 03 November 2004 - 06:45

Did u output anything before session_start? The script needs to send a cookie to initialise the session.

#4 Ricky Baby

Ricky Baby


  • Joined: 01-July 02

Posted 04 November 2004 - 14:16

you kinda defeating the whole point of sessions lol - just overwrite them to NULL

Click here to login or here to register to remove this ad, it's free!