/    Sign up×
Community /Pin to ProfileBookmark

session destroy issue

Hi
I have created a session and set the value as passed.
session_start();
$_SESSION[‘HRAS’] = “passed”;

In logout page I have tried session_destroy() and reset the session value as empty string but when logout is done the session is not destroyed.
After logout out when I login it is directly redirecting to user page instead of asking of authentication. Please help me to solve this issue

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@MrCoderJul 25.2007 — [code=php]
unset($_SESSION);
[/code]


Try that.
Copy linkTweet thisAlerts:
@kalaidauthorJul 26.2007 — Hi,

I have already tried this function.The session value is not cleared even after using this function
Copy linkTweet thisAlerts:
@NogDogJul 26.2007 — See example 2193 on the [url=http://www.php.net/session_destroy]session_destroy[/url] page.
×

Success!

Help @kalaid spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...