473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

session id on every page

greerings agains and thanx in advance.

can you help me with a code that from log on it takes your user name and append it on top of the page, this must be seen in every page a user clicks in the system. i know its got something to do with sessions but my session id is displayed only on the log on screen not on evry page.
Mar 28 '07 #1
2 2065
code green
1,726 Expert 1GB
Pass the session id via URL variable or hidden variable from a form.
[HTML]<input type="hidden" name="session_id" value="<?php echo $sessionID;?>">[/HTML]
Then the session can be restarted using
[PHP]session_start($_REQUEST['session_id]);[/PHP]
Mar 28 '07 #2
ak1dnar
1,584 Expert 1GB
greerings agains and thanx in advance.

can you help me with a code that from log on it takes your user name and append it on top of the page, this must be seen in every page a user clicks in the system. i know its got something to do with sessions but my session id is displayed only on the log on screen not on evry page.
First validate the username against your table if its a valid username then create a session variable for that.

one_page.php
[PHP]
session_start();
$user_code = 'Mike';
$_SESSION['username'] = $user_code;[/PHP]

another_page.php

[PHP]
session_start();
$user = $_SESSION['username'];
echo $user;[/PHP]
Mar 28 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

27
by: mrbog | last post by:
Tell me if my assertion is wrong here: The only way to prevent session hijacking is to NEVER store authentication information (such as name/password) in the session. Well, to never authenticate...
30
by: Robert Tweed | last post by:
Does anyone know a good resource discussing the issues involved in session theft? I've read a couple, but none that really address the problem apart from acknowledging that it is a problem; you...
9
by: William LaMartin | last post by:
I have a problem, mentioned here before, of Session and Application variables disappearing at one site but not at others or on my development computer. The problem is illustrated by an example...
3
by: Jeff Smythe | last post by:
I simply want to execute some code once when a new session of my ASP.NET application is started (I'm not using session state for anything else - just writing some data to a database). I thought...
5
by: ASP.Confused | last post by:
As you can tell from my previous posts on this issue...I'm really confused :-/ I have a few ASP.NET web applications on my web host's "https" server. Our web host has a single "bin" folder for...
6
by: Jon | last post by:
If a session times out, but the forms auth is still logged in it's possible for users to go to pages on the site that need those session variables. I was under the impression that using forms auth...
9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
7
by: Mr Newbie | last post by:
I have written a Custom Control Menu. Its fairly simple but it works well enough. In order to simplify things I decided to store the Menu1 custom control in Session. In the page load event below,...
14
by: Coleen | last post by:
Hi All :-) We have an APSX application using VB.net as the code behind, which uses one or two session variables per page. These Session variables are passed to the final page and calculations...
2
by: Gordon Burditt | last post by:
I had this idea about preventing session fixation, and I'm wondering what anyone else thinks about it. The idea is, essentially, don't allow session ids that YOUR PHP didn't generate (and aren't...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.