please explain about sessions!!

Started on the old forum in August 2012 · view the original in the archive · old links redirect here

4 replies · 2,036 views · started 14 years ago · 1 min read

5 participants
icedroplet1987 Senior · 258 posts #1

how can i make session not expire untill browser closed, and it shud resume after browser open.. likewise coding-talk remember me option.. should only expire on logout.. help me on this friends and also, will it open some security bug in lavalair?

timo Junior · 30 posts #2

$_cookie

$coockiename = session; $cookieexpire = time()+36002430;

if(isset($_SESSION['session'])){ setcookie($cookiename, $session, $cookieexpire); }

if(isset($_COOKIE[$cookiename])){ $session = $_COOKIE[$cookiename]; // or echo $_COOKIE[$cookiename];/// debug }

thats all...

chathumax Newbie · 7 posts #3

session hijack

how to prevent session hijacking?

shushant Developer · 207 posts #4

chathumax wrote: how to prevent session hijacking?

ini_set ('session.cookie_lifetime', 0);

small trick to avoid session hijacking

$ip = 'Ip Addr Here'; 
$_SESSION['ip'] = $ip;

if ( $_SESSION['ip'] === $ip){
      //rest of code here
}
metulj Super moderator Principal · 1,726 posts #5

chathumax wrote: how to prevent session hijacking?

  1. by searching here, before posting
  2. by reading already posted solutions
  3. by using above mentioned solutions

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close